troubleshooting Question

IFRAME resizing

Avatar of mmc98dl1
mmc98dl1Flag for Australia asked on
9 Comments1 Solution1279 ViewsLast Modified:
Hi all,

I have a small piece of JS to resize IFRAME's within the same domain so that the iframe doesnt scroll. The js is within the iframe.

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
                  //-- Frame Handling Script - Wax Interactive - May 2005
                  function resizeIframe() {
                  minFrameHeight = 250;
                  contentHeight = document.body.scrollHeight;
                  if (minFrameHeight > contentHeight) contentHeight = minFrameHeight;
                  this.parent.document.getElementById("contentFrame").style.height = contentHeight;
                  if (this.parent.document.getElementById("contentFrame").style.height)
                  this.parent.document.getElementById("contentFrame").scrolling = "no";
                  document.domain = "";
                  //-- End Frame Handling Script

<iframe name="contentFrame" id="contentFrame" src="" style="border: 1px white solid;" width="100%" height="1000" frameborder="0" scrollbars="0">
            <p>Your browser needs to support I-FRAMES in order to view this area of the website.<br>
            Please download one of the following browsers:</p>
            <p><a href="" target="_blank">Microsoft Internet Explorer</a><br>
                  <a href="" target="_blank">Mozilla Firefox</a>

You can see this in action at and it works just great.

I have now had some trouble in applying the same thing to a different site. - original code. - trial of the code on - trial of iframe on balnk page.

Can anyone see why this isnt working?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros