How to replace entire HTML with external HTML?
<p>Let's say I have this page (page.html):</p>

<pre><code>&lt;html&gt;
    &lt;body&gt;
    &lt;h1&gt;AAA&lt;/h1&gt;
&lt;script type="text/javascript"&gt;
    //&lt;![CDATA[
$(document).ready(function() {

 $.get('page2.html', function(data){
  // I want to replace the entire HTML with the HTML of page2.html
  // but this doesnt' work
  $('html').replaceWith(data);
 });

});    //]]&gt;
&lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Another page (page2.html):</p>

<pre><code>&lt;html&gt;
    &lt;body&gt;
    &lt;h1&gt;BBB&lt;/h1&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>As you can see in my code snippet, I would like to fetch HTML from the page2.html and replace the entire content of page.html with the fetched response.</p>

<p>How to do that?</p>
