title: how to open a page into a new window and print it
body: <p>hi i try to do printing a page but it must open the page first in a new tab.
  i have try to make the code. from my code i can open the page in a new tab but the print function do a print a blank page not the page that i direct open in a new tab.</p>
  
  <p>how to fix that? please help me</p>
  
  <p>this my code </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt;script&gt;
   function myFunction() {
      w=window.open("../../192.168.1.22/print_page/SPL_Karyawan.html");
   w.print();
   w.close();
   }
   
   &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>