再比如简单点的代码如下,自己把src换成外部的url就不行了。
对js不太熟悉,望请赐教
<iframe id="frame_content" src="iframe_b.html" scrolling="no" frameborder="0"
></iframe>
<script type="text/javascript">
function reinitIframe(){
var iframe = document.getElementById("frame_content");
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height = height;
}catch (ex){}
}
window.setInterval("reinitIframe()", 200);
【 在 guizhidao (太冲穴疼) 的大作中提到: 】
: 网上搜了不少代码,如果iframe的src是静态本地的html的话,可以实现
: 但是如果换成
http://www.baidu.com就不行了。
: 比如 代码如下:
: ...................
--
修改:guizhidao FROM 61.149.194.*
FROM 61.149.194.*