title: How to open a file with print dialogue box using JavaScript
body: <p>I want to open one word document using JavaScript as well as open print dialogue box for that opened document window.</p>
  
  <p>Here is my code.</p>
  
  <pre><code>window.open('http://www.tizaq.com');
  
  window.print();
  </code></pre>
  
  <p>It works, but the print dialogue gets opened for the current window, not the newly opened window. How do I do it?</p>