I have an iframe on the page with the following auto-height script.
function autoHeight(e)
{
if ( e.contentDocument ) {
e.height = e.contentDocument.body.offsetHeight + 35;
}
else {
e.height = e.contentWindow.document.body.scrollHeight + 35;
}
}
document.domain = "example.co.uk";
var ifr = document.getElementById('housingdata');
ifr.onload = function() {
autoHeight(ifr);
}
the iframe resizes when the external page loads, but when I go to a new page in the iframe, scroll bars appear and the page does not change in Internet Explorer. In other browsers, the iframe changes because the onload event fires every time.
I use IE8, but the external page sets it to IE7 compatibility mode. Is there a way around IE?
source
share