PasteHTML

Jan 20, 2003

I have an interesting situation where I need to pasteHTML "<script src=whatever.js></script>" using javascript. However, the "</script>" is being interpreted by the browser as ending the javascript before finsihing the job of pasting the HTML....

<SCRIPT language="JavaScript">
// Get a text range for the selection
var tr = parent.page.document.selection.createRange()
tr.pasteHTML("<script src=whatever.js></script>");
</script>

View 1 Replies


ADVERTISEMENT

PasteHTML Not Working Properly

Aug 9, 2005

I'm running this line of code:

oTarget.pasteHTML(formattedHtmlText);

where oTarget is a text range object.

When formattedHtmlText is, say, "<STRONG><BUTTON
class=placeHolder>[[ContAmt]]</BUTTON>&nbsp;text</STRONG>" the HTML is
pasted properly and the UI is changed accordingly.

However, if formattedHtmlText is "<BUTTON
class=placeHolder>[[ContAmt]]</BUTTON>&nbsp;text" the HTML is not
pasted and there is no change in the UI.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved