admin管理员组文章数量:1387331
i want to auto adjust my iframe height according to their content but in same domain it's work properly with contentWindow.height but in case of cross domain its permission denied for accessing iframe dom.
i want to auto adjust my iframe height according to their content but in same domain it's work properly with contentWindow.height but in case of cross domain its permission denied for accessing iframe dom.
Share Improve this question asked Sep 8, 2010 at 12:17 tanujdavetanujdave 2374 silver badges15 bronze badges1 Answer
Reset to default 4For modern browsers you can use the window.postMessage
function to municate between the iFrames belonging to two different domains.
There are also several jQuery plugins that wrap window.postMessage
with older URL hashing techniques for browsers that don't support window.postMessage
. It makes the usage of the technology transparent to the end user.
You can look at the following page (and probably borrow the javascript you need) from here:
Lutron - Ballast Selection Tool
The tool with the dropdowns is actually being loaded from a separate domain into an iFrame. The iFrame is then dynamically resized based on the height of the inner content.
本文标签: javascriptHow to get iframe contentWindow height in cross domainStack Overflow
版权声明:本文标题:javascript - How to get iframe contentWindow height in cross domain - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744489583a2608655.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论