title: JavaScript embedding <script> tags in document.write not working
body: <p>I'm not sure what is wrong with my code, but when I try and add <code>actorWin.document.write('&lt;script type=\"text/javascript\"&gt;&lt;\/script&gt;')</code>
  everything gets screwed up. Without this line, the code works fine.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;create a window&lt;/title&gt;
  
  &lt;script type='text/javascript'&gt;
    function Movie(title, actor) {
      this.title = title;
      this.actor= actor;    
    }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script type='text/javascript'&gt;
  
    var documentary = new Movie('http://www.imdb.com/title/tt0358456/?ref_=fn_al_tt_2','http://en.wikipedia.org/wiki/Joaquin_Phoenix');
    var movieWin = new Object();
    var actorWin = new Object();  
  
    newWin=window.open('','Win','width=300,height=200,top=100,left=600');
  
     newWin.document.write(
     "&lt;script type='text/javascript'&gt;" +
          "function PopUpWindowMovie(url) {" +
               "movieWin=window.open(url,'','height=600,width=800,left=400,top=100,scrollbars,status,resizable');" +
               "movieWin.focus();}" + 
          "function PopUpWindowActor(){" +
               "actorWin=window.open('','','height=600,width=800,left=400,top=100,scrollbars,status,resizable');" +
               "actorWin.focus(); " +
               "actorWin.document.write('Joaquin Phoenix is a great actor and a long time vegan.&lt;br /&gt;');" +
               "actorWin.document.write('&lt;script type=\"text/javascript\"&gt;" +
               "function test() {" +
                      "alert(\"here\");" +
               "} &lt;\/script&gt;');" +
          "}" +
      "&lt;\/script&gt;"); 
     newWin.document.write("This is a MUST SEE movie: &lt;h1&gt;Earthlings (2005)&lt;/h1&gt;");
     newWin.document.write("&lt;a href=\"javascript:PopUpWindowMovie('"+documentary.title+"')\"&gt;Go to see the movie info&lt;/a&gt;&lt;br /&gt;");
     newWin.document.write("&lt;a href=\"javascript:PopUpWindowActor()\"&gt;Go to see the lead actor&lt;/a&gt;");
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>