我创建了一个script
,它将一个iframe加载到父DOM中。 是这样的:Iframe内容会冻结?无效之后
var myIframe = createFrame("myIframe","http://foaas.com/awesome/mrstackoverflow") // Just an example
基本上做到这一点
function createFrame(id, link, style, modal){
var iframe = document.createElement('iframe');
iframe.frameBorder=0;
iframe.scrolling="no";
iframe.setAttribute("frameborder", 0);
iframe.setAttribute("allowtransparency", true);
iframe.id=id;
iframe.setAttribute("src", link);
return iframe
}
,并添加到DOM与
var myScript = document.getElementById('myScript');
var parent = myScript.parentElement;
parent.insertBefore(myIframe, myScript.nextSibling);
所有这一切工作的...
我的问题是经过一段时间后,浏览器选项卡变为“无效”(?)
会出现这种情况? See image
屏幕方面,iframe内的内容是这样的冷冻的和错误(与我的其他选项卡的一些随机的部分。)喜欢看。 只有IFRAME但一旦我把它作为刷新什么都没有发生在DOM中做一些事情,一切都恢复到正常范围内。
到目前为止,从来就只遇到了的Mac和Safari此错误。
任何想法,这里是什么情况,什么什么我可以寻找那些可能会导致这样的事情?
我应该从哪里开始看?在脚本中或在iframe脚本中。两者都由我主持。它有可能是iframe.setAttribute("allowtransparency", true);
?