title: Avoid document.write? Any alternatives?
body: <p>I am currently using document.write to inject html into my framework. I'm using Backbone, Marionette, require.js, jQuery.</p>
  
  <p>I want to avoid using document.write since it has performance and browser impacts.</p>
  
  <p>Please suggest an alternative.</p>
  
  <p>My current code:</p>
  
  <pre><code>    var html = this.compilePageHtml(); //We get some HTML code
      this._previewWindow = window.open("about:blank", "PreviewWindow","width=320, height=570, scrollbars=yes" ); 
      this._previewWindow.document.write(html); //Loads HTML in new window popup
  </code></pre>