title: How can I stop an iframe reloading when I change its position in the DOM?
body: <p>Is there any way to stop an iframe re-loading its contents when I change its position within the DOM? Simple example:</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
  function moveiframe() {
      var dest = document.getElementById('newparent');
      dest.appendChild(document.getElementById('googleframe'));
  }
  &lt;/script&gt;
  &lt;iframe src=&quot;http://www.google.com&quot; id=&quot;googleframe&quot;&gt;&lt;/iframe&gt;
  &lt;input type=&quot;button&quot; onclick=&quot;moveiframe()&quot; value=&quot;Move&quot; /&gt;
  </code></pre>
  <p>clicking the &quot;Move&quot; button changes the parent of the iframe, and reloads its contents (in Firefox and Chrome, but not IE).</p>
  <p>Any suggestions would be much appreciated!</p>
  <p>[Updated with background info]</p>
  <p>I'm loading the site's adverts in placeholder divs at the bottom of the page (to prevent advert loading from holding up the page load) - and then shifting the divs they've been written in to their correct container once loaded. It all works great... unless the ad that gets served uses an iframe (like google adsense) in which case the ad gets loaded twice and the serving is messed up.</p>