title: Window closing before content goes to Printer (JavaScript)
body: <p>I have the following block of code which opens a new browser window with the current window contents, except in a stripped down layout for printing. It then sends the new page to the printer and finally closes the page. The issue i'm having is that the new window appears to be closing before the printer tab is getting all the data. Perhaps a call-back from the print() which then calls close() on completition? How would I go about implementing this functionality?
  Thanks in advance.</p>
  
  <p>PRINT LISTING    </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function generate_url()
      {
          //var go_href = 'http:&lt;?php echo BASE_URL ?&gt;/admin/reservations/print_list';
          myWin = window.open('http:&lt;?php echo BASE_URL ?&gt;/admin/reservations/print_list');
          myWin.focus();
          myWin.print();
          myWin.close()
          return false;
      }
  
  &lt;/script&gt;
  </code></pre>