Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
Adding a block of HTML Code



imegadeals
New User

Feb 18, 2005, 10:28 AM


Views: 8244
Adding a block of HTML Code

I love the HTMLAREA product and use it everyday. I have a standard snippet of code that I use quite frequently and would like to setup a button to insert this code in the HTMLAREA. The snippet of code should be placed at the point of cursor without overlaying the existing contents of htmlarea . I created a button which uses the editor_insertHTML function. to insert the code, but because of the special characters in the block of code below, I am unable to get it to work. I am open to any ideas you might have.
----------------------------------------------------------------------------------------------
<input type=button value='Click Here'
onclick='window.open("http://www.imegadeals.com/go.php?url=" +
escape("http://www.msn.com"));'>
----------------------------------------------------------------------------------------------

Thanks, Steve


(This post was edited by imegadeals on Feb 19, 2005, 9:03 AM)


imegadeals
New User

Feb 19, 2005, 8:09 AM


Views: 8208
Re: [imegadeals] Adding a block of HTML Code

CoolOK... I figured it out. Here is what I came up with:

var myText = '<input type=button value=' + '"' + 'Click Here' + '"' + 'onclick=' + "'" + 'window.open' + '(' + '"' + 'http://www.imegadeals.com/go.php?url=' + '"' + ' + escape' + '(' + '"' + 'Place Link Here' + '"' + '))' + ';' + "'" + '>';
editor_insertHTML(objname, myText);


(This post was edited by imegadeals on Feb 19, 2005, 9:04 AM)