ابحث في الدعم

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Iframe content disappear if script loaded from string

  • 2 (ردّان اثنان)
  • 2 have this problem
  • 1 view
  • آخر ردّ كتبه Lehych

more options

I've got strange behaviour of FireFox 3.6-14 (have no 3.0 for now) with whis sample of code http://pastebin.com/CzzfB709 Short explanation: if we create SCRIPT element and push script text from string and at the same time this script (that comes from string) create IFRAME, then iframe content is reloaded after script finished; In sample code you can see that we have `scriptText` variable that contains JS code. Then we create SCRIPT tag and put string code there. What you see: till you not close alert windows, you see text in iframe, but when you close it, iframe became blank.

I also have an example of the same code from string if it pasted directly into HTML. Everything seems fine there. http://pastebin.com/4JcajiDQ

I ask if anyone can just explain me, why is it hapend.

I've got strange behaviour of FireFox 3.6-14 (have no 3.0 for now) with whis sample of code http://pastebin.com/CzzfB709 Short explanation: if we create SCRIPT element and push script text from string and at the same time this script (that comes from string) create IFRAME, then iframe content is reloaded after script finished; In sample code you can see that we have `scriptText` variable that contains JS code. Then we create SCRIPT tag and put string code there. What you see: till you not close alert windows, you see text in iframe, but when you close it, iframe became blank. I also have an example of the same code from string if it pasted directly into HTML. Everything seems fine there. http://pastebin.com/4JcajiDQ I ask if anyone can just explain me, why is it hapend.

All Replies (2)

more options

Although you haven't yet received a response on the mozillaZine web development forum, I do think that is a better board for this discussion.

Iframe content disappear if script loaded from string - mozillaZine Forums

more options

As I think, this is some kind of a problem inside FireFox. So I just didn't know where to post it. Usually I'll prefer developer discussion group or maillist but I could not find such for FireFox. If you shure that mozillaZine is a best place for it than I'll wait. But I'm not shure whether it is still active community based on it's main page.