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.
精彩评论