On or about 8/30/2008 17:37, it came to pass that DL wrote:
Quote:
That is, for an iframe with onload attribute to preset a width and
height then depending on the length of its content to auto-expand
instead of scrolling. The following URL is quite interesting,
http://www.phpmix.org/iframe_height_auto_resize,
however, it failed to work for me, OS = XP w/ sp2; brower = IE7, but
my app is quite complicated... it load the iframe inside a javascrip-
driven window...
>
And their forum has been closed, so, I have to post the question here,
the thrown js error is, "DYNIFS not defined". Any idea on a solution
would be appreciated.
>
tia.
I struggled with this issue a few years back and eventually gave up. I
had it working if it was within the same domain, but when it was across
two separate domains I bumped into browser cross domain restrictions and
it refused to work, even for something (IMHO) as innocuous as setting
the IFrame height.
Since my site was supposed to provide the Iframe to numerous foreign
sites, I wrote a PHP script that generates Javascript filling in a Div
eliminating all the Iframe issues.
Quick example on how to do this
On source page on any domain:
www.foobar.com/extermalcontent.html
<div id='ContentDiv'>
<noscript><b>*****WARNING JAVASCRIPT IS DISABLED, IT MUST BE ENABLED TO
PROPERLY VIEW THIS PAGE*****</b>
</noscript>
....Loading content from EXAMPLE.ORG...
</div>
<script type="text/javascript"
src="http://www.example.org/ExternalContent.php?parm1=sample>
</script>
The PHP script generates javascript
:
function SetDiv()
{
document.getElementById('ContentDiv').innerHTML = '<p>whatever you want</p>'
}