日期:2014-05-16  浏览次数:20411 次

javascript高手、Ajax高手请进:IFrame内嵌跨域网页自动扩高的问题?
<html>
<body>
<table   border= "1 "   width= "100% "   cellspacing= "0 "   cellpadding= "0 ">
<tr>
<td> <iframe   frameBorder=0   id= "info_iframe "   name= "info_iframe "   style= "height:   expression(info_iframe.document.body.scrollHeight) "   scrolling= "no "   width=98%   src= "http://www.163.com "> </iframe> </td>
</tr>
</table>
</body>

由于跨域info_iframe.document.body.scrollHeight就报“没有权限”的错误,请问怎么去掉iframe页里的滚动达到自动阔高效果呢?

------解决方案--------------------
onload= "this.height=Iframe.document.body.scrollHeight "
------解决方案--------------------
切~~~~
------解决方案--------------------
<iframe name= "pindex " src= "abc111.htm " frameborder=false scrolling= "auto " width= "100% " height= "100% " frameborder=no onload= "document.all[ 'pindex '].style.height=pindex.document.body.scrollHeight " > </iframe>
------解决方案--------------------
调整窗口大小的代码放在被包含页面里,
用window.resizeTo
------解决方案--------------------
成功案例:

在自己主机中建个a.html,Iframe 163.com,设置这个a.html的width和height,使其将163.com的页面能全部显示。

然后自己的页面再调用这个a.html页面,且有权限!
------解决方案--------------------
MARK