troubleshooting Question

IFRAME resizing

Avatar of mmc98dl1
mmc98dl1Flag for Australia asked on
JavaScript
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 = "adage.com.au";
                  parent.window.scroll(0,0);
                  //-- End Frame Handling Script
      //-->
      </SCRIPT>

<iframe name="contentFrame" id="contentFrame" src="http://jobs.adage.com.au/" 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="http://www.microsoft.com/ie" target="_blank">Microsoft Internet Explorer</a><br>
                  <a href="http://www.mozilla.org/products/firefox/" target="_blank">Mozilla Firefox</a>
            </p>
</iframe>

You can see this in action at http://www.adage.com.au/findajob.asp and it works just great.

I have now had some trouble in applying the same thing to a different site.
http://www.hireinsight.com.au/jobseeker.html - original code.
http://www.hireinsight.com.au/iframe.html - trial of the adage.com.au code on hireinsight.com.au
http://www.hireinsight.com.au/iframe2.html - 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