javascript
JS跨域控制IFrame高度自适应
proxy.html放在域名A頁面,域名A頁面中的iframer的id命名是iFrame,和域名B里面的Js里面的變量對應(yīng)
<iframe style="HEIGHT: 560px" id="iFrame" framespacing="0" height="560" marginheight="0" border="0" src="http://www.uzuz8.com/post/425.html"? frameborder="0" width="683" marginwidth="0" scrolling="no"></iframe>
IFrameJS.js放在域名B下面,在域名A頁面嵌入的域名B的頁面中引用它,即可使域名B該頁面高度自適應(yīng)。
通俗一點就是,我在http://www.uzuz8.net/頁面中通過iframe引用了http://www.uzuz8.com/post/425.html,要想讓http://www.uzuz8.com/post/425.html在http://www.uzuz8.net/頁面中高度自適應(yīng),就把proxy.html放在http://www.uzuz8.net/下面,把http://www.uzuz8.net/頁面中iframe的id命名為iFrame,并在http://www.uzuz8.com/post/425.html引用IFrameJS.js即可。
?proxy.html和IFrameJS.js下載:/Files/chendaoyin/iframe跨哉高度自適應(yīng).7z
總結(jié)
以上是生活随笔為你收集整理的JS跨域控制IFrame高度自适应的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C# 属性反射
- 下一篇: 单IP无TMG拓扑Lync Server