title: Store HTML code in a string in javascript
body: <p>I am copying the "view source" of an external html page (1.html) into a variable in javascript in another html page (2.html). But due to the indentation, quotes, spaces and tags in the html page, i am not able to store all of the source code in the string at one go. Is there any function which can be used to do so? </p>
  
  <p>Contents of 1.html:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;1 &lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      This is just plain text body
      &lt;div id="new"&gt; This id div text&lt;/div&gt;
      &lt;span&gt; This is span text &lt;/span&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Contents of 2.html:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" language="javascript"&gt;
  var str="&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;2 &lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      This is just plain text body
      &lt;div id="new"&gt; This id div text&lt;/div&gt;
      &lt;span&gt; This is span text &lt;/span&gt;
  &lt;/body&gt;
  &lt;/html&gt;";
  
  alert (str);
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>if a paste all the contents copied from 1.html after var=" inside 2.html, it does not take all of it.. Any solution to this? </p>