當我嘗試訪問的iframe,我得到這個錯誤,我不知道我做錯了。有人可以幫我解決這個問題嗎?訪問的IFrame
var ifrm = document.getElementById('iframe'),
ifrm = (ifrm.contentWindow) ? ifrm.contentWindow :
(ifrm.contentDocument.document)
? ifrm.contentDocument.document :
ifrm.contentDocument;
ifrm.open();
ifrm.write("Hello World!");
ifrm.close();
這是我收到的錯誤:
遺漏的類型錯誤:未定義
遺漏的類型錯誤的無法讀取屬性 '文件':無法讀取的不確定
財產 '的readyState'
***不能讀取屬性「文件」的不確定***是相當清楚的 – xandercoded
'iframe.contentWindow'是不是跨瀏覽器? –
附註:對嵌套的三元運算符說「不」。 – FishBasketGordo