title: How to change iframe src without reloading the iframe?
body: <p>I have two frames of which I copy the content of the first (<em>myframe</em>) to the second (<em>myframe2</em>) using JavaScript and set <em>myframe2</em>'s src:</p>
  
  <pre><code>&lt;iframe id="myframe" src="../Page1.aspx" width="100%" height="100px"&gt;&lt;/iframe&gt;
  &lt;iframe id="myframe2"  width="100%" height="100px"&gt;&lt;/iframe&gt;
  
  &lt;button onclick="myFunction();return false;"&gt;Try it&lt;/button&gt;
  
  &lt;script&gt;
      function myFunction() {
          var iframe1 = document.getElementById("myframe");
          var iframe2 = document.getElementById("myframe2");
  
          iframe2.contentWindow.document.body.parentElement.innerHTML = iframe1.contentWindow.document.body.parentElement.innerHTML;
          iframe2.setAttribute("src", iframe1.src);
      }
  &lt;/script&gt;
  </code></pre>
  
  <p><em>FrameSecond</em> reloads after "src" attribute is set, but I don't need it to do so. Can anyone help me with this?</p>