Hi, i've met a strange behaviour in Firefox with this simple script:
<html>
<head>
<script type="text/javascript">
window.setTimeout(function(){
var ifr=document.createElement("iframe");
ifr.src="about:blank";
document.body.appendChild(ifr);
var doc=ifr.contentDocument || ifr.contentWindow.document,
div=doc.createElement("div");
div.innerHTML="test";
window.setTimeout(function(){
doc.body.appendChild(div);
},500);
},500);
</script>
</head>
</html>
This piece of code creates a blank iframe and appends it to the body of the current page, then it creates a div element that contains a simple text and appends it to the body of the iframe.
In every browser (IE, Safari, Chrome, Opera) it works, but in Firefox (i'm using the version 3.6.3) the div does not appear inside the iframe and no error is thrown.
I think that there must be some stupid error somewhere but i can't find it, have you got some idea?
PS: those window.setTimeout
are just a simple way to make sure that the dom is loaded in the page and in the iframe.