title: How to display a complete html page when I have it's source html in iframe?
body: <p>I want to display another html page on my html page, that html page is generated. So I don't have it's src, only the content. It has doctype, head, body, all stuff. So I decided to use iframe. The problem is that I can't assign the whole text to a variable, as I get errors, that there is an unsupported character, like "&lt;" etc. How to deal with it?</p>
  
  <p>I'm trying to do something like this:</p>
  
  <pre><code>window.onload = function() {
  var iframeDocument = document.getElementById("myIframe").contentDocument;
  var ss = "
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;";
  iframeDocument.write(ss);
  iframeDocument.close();
  }
  </code></pre>
  
  <p>So my problem is how to escape that text so it won't cause browser errors?
  Also html content is generated dynamically, so in my code there is no that text, there is struts action variable. But after my code gots executed in browser, that's what I see in there.</p>