title: javascript resize iframe height dynamically issue
body: <p>I'm having an issue resizing an iframe to fit the content located within the frame'd page.  I used a suggestion I found here to resize the frame dynamically.</p>
  
  <p>In my frame'd pages I have </p>
  
  <pre><code>&lt;body onload='parent.resizeIframe(getDocHeight())'&gt;
  
  function getDocHeight() {
  var D = document;
  alert(D.URL);
  return Math.max(
      Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
      Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
      Math.max(D.body.clientHeight, D.documentElement.clientHeight)
  );
  </code></pre>
  
  <p>}</p>
  
  <p>And in the page containing the iframe I have this</p>
  
  <pre><code>function resizeIframe(newHeight) {
    var showsFrame = document.getElementById('frm');
    showsFrame.style.height = parseInt(newHeight) +'px';
  }
  </code></pre>
  
  <p>The function is getting called correctly by each frame'd page, but for some reason the 'newHeight' parameter being passed is keeping the largest height value.  For example if I have 2 frame'd pages one with a scroll height of 300px and the other with 500px. When I first click my link to load the 300px page it works fine, but if I click the link to the 500px page and then try and come back to the 300px page, the value of 'newHeight' remains at 500.  Any ideas? TIA</p>