Hello,
I have WordPress installed in a directory of my website, and I'm using an iframe on the homepage to embed the blog. I'm using a javascript code that I found online to automatically resize the iframe based on the content inside of it. This is the code:
This works perfectly in Google Chrome. However, in Firefox I get this error in the console:
I don't have any experience with javascript, but this makes no sense to me, because it should work since the iframe document is on the same domain and server as the parent page. The parent is "mysite.com/index1.html" and the iframe document is "mysite.com/blog/".
Why is Firefox complaining about this? It shouldn't violate the "same origin policy" that I have read about. Any help with getting this to work would be appreciated.
I have WordPress installed in a directory of my website, and I'm using an iframe on the homepage to embed the blog. I'm using a javascript code that I found online to automatically resize the iframe based on the content inside of it. This is the code:
Code:
<script type="text/javascript"> function resizeIframe() { document.getElementById('blog').style.height = document.getElementById ('blog').contentWindow.document.body.scrollHeight + 'px'; } </script>
Code:
Error: Permission denied to access property 'document' Source File: http://mysite.com/index1.html Line: 24
Why is Firefox complaining about this? It shouldn't violate the "same origin policy" that I have read about. Any help with getting this to work would be appreciated.
Comment