This killed me, like everyone else, and I gave an example that seems to be compatible with IE8, Chrome, Safari, and FF. I have not tested it in IE7 or IE6.
I canβt take a 100% loan, because I have pieces from different sites. Most of the solutions I came across have complicated the problem.
I use coldfusion, so you will need to check the browser in your own language.
<SCRIPT LANGUAGE="JavaScript"> function resizeIframeToFitContent(iframe) { </SCRIPT>
If it is FF, Safari or Mozilla (any version), you can use this script
<SCRIPT LANGUAGE="JavaScript"> function resizeIframeToFitContent(iframe){ </SCRIPT>
IE8 is a little nicer for us programmers
<SCRIPT LANGUAGE="JavaScript"> function resizeIframeToFitContent(iframe) { </SCRIPT>
Here is an iframe script you can remove the background color and set your own width and URL.
<IFRAME id="myiframe" name="myiframe" src="<your url>" width=800 style="background-color: #FAF9F8;" onload="resizeIframeToFitContent(this)" scrolling="no" frameborder="0">
This pretty much covers it.
source share