title: How to force an iFrame to reload once it loads
body: <p>I have numerous iframes that load specific content on my pages. Both the parent and iframe are on the same domain. </p>
  
  <p>I have a scrollbar inside the iframe that doesn't seem to load correctly in all browsers. But when I refresh the iframe it loads perfect. I have no idea why it does this. </p>
  
  <p>I have used the meta refresh, which works but I don't want the page to refresh constantly, just once. </p>
  
  <p>The solution I'm looking for will reload the iFrame content after the iFrame is opened, with a minimal delay. </p>
  
  <hr>
  
  <h2>Edit</h2>
  
  <p>I realized that my page loads all of my iframes when the index is loaded. The iframes appear in a jQuery overlay, which is also loaded but visibility:hidden until called. So on this call is when I would want the iframe to be reloaded. </p>
  
  <p>Could anyone help me come up with a Javascript function that reloads the iFrame when I click the link to the iFrame? I've gotten close but I know nothing about js and I keep falling short. I have a function that reloads the page, but I can't figure out how to get it called just once. </p>
  
  <p>I have this so far:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
  var pl;
  var change;
  pl=1;
  
  function ifr() {
  
  if (pl=1) {
      document.location.reload([true]);
      alert("Page Reloaded!");
      change=1;
      return change;
  }
  
  change+pl;
  
  }
  </code></pre>
  
  <p></p>
  
  <p>So basically it uses the document.location.reload which works to reload the page. I'm trying to then make pl change to something other than 1 so the function doesnt run again. I've been calling this JS from the body with onLoad.</p>