0
這是我的功能。並在onload
事件處理函數我試圖計算iframe
的scrollHeight
。 但我只收到錯誤消息。有人可以幫忙嗎?計算實際的iframe高度時出錯
function showHBewertung(W3CElement, objCode) {
var iframe = document.createElement("iframe");
iframe.className = "bewertung_iframe"
iframe.src = "http://example.com?giatacode="+objCode;
W3CElement.appendChild(iframe);
iframe.onload = function() {
var height=iframe.contentWindow.document.body.scrollHeight;
iframe.style.cssText = "width:100%;height:" + height + "px";
}
}
什麼錯誤信息詳細說? – reporter
螢火蟲顯示什麼? – Rahul
錯誤:權限被拒絕訪問屬性「文檔」 – user160820