title: Unable to insert stylesheet/script into window.open
body: <p>I have been fighting this issue for quite some time now, and have been (still) unable to print my div with its styling.</p>
  
  <p>Currently, my script is:</p>
  
  <pre><code>$('#printMeButton').click(function () {
      //alert("a");
      var data = document.getElementById('thisPrintableTable').outerHTML;
  
      var mywindow = window.open('', data);
      mywindow.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;Print Me!!!&lt;/title&gt;');
      // mywindow.document.write('&lt;link rel="stylesheet" type="text/css" href="Site.css" media="screen"&gt;');
      mywindow.document.write('&lt;/head&gt;&lt;body&gt;');
      mywindow.document.write(data);
      mywindow.document.write('&lt;/body&gt;&lt;/html&gt;');
  
      mywindow.document.close();
      mywindow.focus();
      mywindow.print();
      mywindow.close();
      return true;
  
  });
  </code></pre>
  
  <p>which is nested within a <code>$(document).ready</code> function.</p>
  
  <p>When I include the desired stylesheet (currently commented out), Nothing appears in the print preview.</p>
  
  <p>I also have some script that has an effect on the appearance of the table, and, as such, I believe this may hold the key of having these included into the popup window.</p>
  
  <p>How can i include this into the new popup?</p>
  
  <p>Could someone please suggest a way of printing this as it stands?</p>
  
  <p><strong>Edit History</strong></p>
  
  <ul>
  <li><em>removed space at end of <code>&lt;/head&gt;&lt;body&gt;</code></em></li>
  <li><em>Changed <code>var data</code> to have <code>outerHTML</code> instead of <code>innerHTML</code></em></li>
  <li><em>Altered Question/details from better understanding of issue</em></li>
  </ul>