...

View Full Version : Hi Please Help



adir
12-20-2010, 11:58 AM
Hi guys, it seems my code is not compatible to chrome, and firefox, while working just fine in IE 8.

Can you help me to write that differently?


<script language="JavaScript">
<!--
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('the_iframe').contentWindow.
document.body.scrollHeight;

//change the height of the iframe
document.getElementById('the_iframe').height=
the_height;
}
//-->
</script>

Common
12-20-2010, 01:15 PM
2 minor things occur to me as possible solutions when looking over that, although equally it's possible that neither will help:

1. I've heard in the past utterances that contentWindow and contentDocument are sometimes uncompatible with various browsers etc, so try using contentDocument and see if that helps any.

2. Modify the style of the element instead of it's "height", i.e. .style.height=the_height rather than just height. Similarly for scrollHeight (maybe... I avoid iframes so it's not a property i've ever had to use so don't quote me on that one.)

Hopefully one of those might help.

Edit: Oh, i just noticed, use <script type="text/javascript">, language="Javascript" is archaic. I doubt that's causing the problem but gotta keep up with standards.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum