-3

I don't see anyone else really trying to accomplish what I am... LOADS of people want to replace some node via innerHTML property however, I not only want to do this but I ALSO want to replace it with javascript.

Here is my example script which is working fine in all versions of Firefox: http://syn4k.site90.net/working_test/ EDIT: If the above link does not work, try this one: http://www.syn4k.freehosting.com/working_test/

You will note that it is NOT working in IE8. I'm guessing it is not working in any version of IE...

The process I have created at the link is simple: 1. The user clicks to being the process. 2. A new window is opened. 3. Data from the new window is sent back to the opener and inserted into the DOM. 3.note. The data being sent back is javacript and should execute as it does in Firefox.

1 Answers1

8

I got a look before your hosting went dowm; You cannot set innerHTML of a script node in IE, instead you need to newdiv.text = your_string_with_js; (or append a createTextNode() to it).

Alex K.
  • 171,639
  • 30
  • 264
  • 288
  • @All: I added a new link in the description too. I'll look over your comment. –  Oct 25 '11 at 16:12
  • Thanks but when I make that change, I get the following errror: Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729) Timestamp: Tue, 25 Oct 2011 16:14:10 UTC Message: Syntax error Line: 66662333 Char: 1 Code: 0 URI: http://134.173.185.105/working_test/ I know that this error is invalid as no such line exists. –  Oct 25 '11 at 16:15
  • Does the js payload work in IE if written into a regular page? – Alex K. Oct 25 '11 at 16:21
  • Yes, the script works in IE if appended to the page manually. –  Oct 25 '11 at 16:34
  • Ok...VERY oddly, it is now working. Thank you! –  Oct 25 '11 at 16:52