2

I want to resize the iframe's height when the page load successfully.

Here is my code:

//Parent domain: www.test.com
//Iframe contents domain: test.com
var currentdomain = document.domain; //currentdomain == "www.test.com"
currentdomain = "test.com";
var subWebHeight = $("#iframePage").contents().find("body").height();
$("#iframePage").height(subWebHeight + 30);

These code works well in chrome and firefox, but when I run the script on IE browser, it always throw the "Permission denied" when execute "$("#iframePage").contents()".

It was weird, I can run the script "$("#iframePage").contents()" in IE console successfully.

BTW, is there a way to disable the security of IE browser? Some configuration like "--disable-web-security" on chrome, that I can access the contents of an iframe with different domain. This is only be used for development, not production.

Anyone can help on it? Thanks

0 Answers0