开发者

Set the Height of an IFRAME based on its Document's Height (Cross Domain)

I tried using the top.location.hash approach to have a site on a different domain (also within an iframe) set the top windows hash value to its own height, but I've now discovered this isn't cross domain safe.

What other options do 开发者_Go百科I have to make sure that the iframe constantly resets it's height when the iframe document is finished loading?


You can use window.postMessage() to communicate across domains. See http://caniuse.com/#search=postmessage for the current level of support - pretty much all browsers and even MSIE starting with MSIE 8.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜