Wednesday, 21 August 2013

Loading indicator stays in Firefox after iframe finished loading

Loading indicator stays in Firefox after iframe finished loading

I have an iframe placed in my page's body like this:
<iframe src="about:blank" onload="this.contentWindow.document.write('some
text')">
It works well enough, the onload event replaces iframe's content with
"some text" and thats it.
BUT in Firefox it causes the spinning wheel "loading indicator" which
shows you that the page is being loaded to never go away. There is only
text being inserted into the iframe, so there is no other content hanging
around, waiting to be loaded. When I remove the iframe from the page it
removes the problem, so I know, it is the said iframe which is causing it.
It works correctly in IE and Chrome.
Now, I can do something like this:
<iframe src="about:blank" onload="this.contentWindow.document.write('some
text'); t.contentWindow.stop();">
Which fixes the problem in Firefox, but it prevents any images in the
iframe from loading (i don't use any in the example insert text, but they
will be added later on).
So, how do i go about fixing this?
Thanks

No comments:

Post a Comment