Javascript in document.write
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2004995/how-can-javascript-make-new-page-that-contains-more-javascript">How can JavaScript make new page that contains more JavaScript?</a>  </p>
</blockquote>



<p>I tried writing this: <code>document.write('&lt;script&gt;document.write("test")&lt;/script&gt;');</code> and it displays <code>'); });//]]&gt;</code> I believe that it's because I wrote <code>&lt;script&gt; &lt;/script&gt;</code> in it, why does it happen and what can I do (I purposely want it surrounded by <code>&lt;script&gt;</code>?</p>

<p>Thanks.</p>
