搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

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.