title: Writing html to a new window with javascript
body: <p>I have been doing some research on opening a new window and writting HTML to it with jQuery/JavaScript and it seems like the proper way to do it is to:</p>
  
  <p>Create a variable for the new window</p>
  
  <pre><code>var w = window.open();
  </code></pre>
  
  <p>Insert the new data and work the variable</p>
  
  <pre><code>$(w.document.body).html(data);
  </code></pre>
  
  <p>And to me, that makes complete sense. however when i try to incorporate this into my script ("data" being the holder for the HTML) it does not open a new window... unless I'm just missing something simple which as far as I can tell it looks great...</p>
  
  <pre><code>function newmore(str) {
      var identifier = 4;
      //get the history
      $.post("ajaxQuery.php", {
          identifier : identifier,
          vanid : str
      },
      //ajax query 
      function(data) {
          //response is here
          var w = window.open();
          $(w.document.body).html(data);
      });//end ajax                
  }
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>P.S. there seems to be no errors in the console</p>