我創建了一個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);
?