View Full Version : dynamic iframe height; not a function, not defined.

05-28-2005, 04:32 AM
I'm trying to use a function that I found on these forums to dynamically adjust the height of an iframe, but the page always returns an error stating that "heightboss is not a function" if I use document.heightboss() or "heightboss is not defined" if I just use heightboss(). This is very frustrating. It happens also with any function I put in, so I don't think it has to do with this one particular.

But here's the code:

<script type="Javascript">

//This code by narmi2 from codingforums.com. Thanks narmi!

function heightboss() {
var the_height=document.getElementById('content').contentWindow.document.body.scrollHeight;


This is the code I'm using to call it.

<iframe onLoad="javascript:top.heightboss();" name="content" id="content" width="70%" align="center" frameborder="0" scrolling="no"></iframe>

Please help.

It doesn't work in IE either. The error there is "Object doesn't support this property or method".

Thanks in advance.

05-28-2005, 08:05 AM
have a look at the code i use here:


go to Orders -> completed or outstanding orders.

that what u need?

Mr J
05-28-2005, 11:40 AM
Or take a look at this example


06-01-2005, 05:00 AM
Thanks guys. I'm using that code now, Mr. J, thank you.