We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Iframe content disappear if script loaded from string

  • 2 回覆
  • 2 有這個問題
  • 1 次檢視
  • 最近回覆由 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.

所有回覆 (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.