Iframe Errors Ahoy

Iframe Errors Ahoy

本文关键字:Ahoy Errors Iframe      更新时间:2023-09-26

下面的iframe是为适应其内容而设计的。它适用于Firefox,但不适用于Chrome。

<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>

当页面在Chrome中加载时,我会收到以下错误:

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 

当我专门使用onload事件时,为什么它会认为iframe是未定义的?我对网页设计相当陌生;如果问题很明显,请原谅我。

尝试不使用真正的东西:

http://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_iframe_seamless