[Javascript] iframe size (may be an HTML issue)

Chris Basken chriz at basken.com
Fri Jan 30 14:36:16 CST 2004


Silly question time.

If I'm pulling another HTML doc into an iframe, is it possible to set the
iframe's height to fit the content of the HTML doc?  This is a template page
that uses JS to define the src of the iframe depending on another parameter,
but different src docs have different lengths and I'd like to avoid scrolling.

I know I can use:

    document.all['myIframe'].style.height = x;

So I need to determine x from the content of the HTML doc that's being pulled
in, but that would depend on how it flowed, so I can't really know that ahead
of time (each such doc has a master table, so I can match widths, but how do I
determine the height?).






More information about the Javascript mailing list