Javascript replace content and refresh it with new content which new content from outerHTML
<p>Is possible to refresh page with new content which new content from outerHTML? I'm having problem which I want to refresh page until 2 seconds, proccess 0-2 seconds to get new HTML with innerHTML and etc. But after I get new content from outerHTML. I difficulty to refresh this content with HTML from outerHTML.</p>

<p>Below my example code:</p>

<pre><code>&lt;script&gt;
    // code blablabla to get new content. This has been fix code, and below code to start refresh page with outerHTML.

    window.onload = function(){
                    tes();
                };

                function tes(){
                    var htmlAll = document.documentElement.outerHTML;
                    setTimeout(function(){howCodeRefresh()}, 2000);
                    function howCodeRefresh(){
                        // how code to refresh page and replace all content with variable htmlAll
                    };
                };
&lt;/script&gt;
</code></pre>

<p>My question. Is possible to do it? If yes, how to do it?</p>

<p>Thanks.</p>
