2013-08-25 40 views
0

以下iframe的設計適合其內容。它適用於Firefox,但不適用於Chrome。Iframe Errors Ahoy

<iframe src="Splash.html" seamless=true width=99% height=100% scrolling=no name="Content" id="Content" onload="this.height = this.contentWindow.document.body.scrollHeight + 10;"> 
</iframe> 

頁面在瀏覽器加載後,我得到了以下錯誤:

Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match. Index.html:35 
Uncaught TypeError: Cannot read property 'body' of undefined 

爲什麼會認爲iframe是不確定的,當我專門用於onload事件?我對網頁設計頗爲陌生;如果問題很明顯,請原諒我。

+1

您是否嘗試過添加 「」 每個屬性? – Yotam

+0

你能改說嗎?我不明白你想說什麼,對不起。 – Someone

+1

錯誤是說你有一個跨域錯誤。你在處理文件協議? – epascarello

回答