title: Using onafterprint in Chrome & Safari
body: <p>I am aware that until recently <code>onafterprint</code> was only native to IE.  Recently HTML5 has added it to its list of events.  I have only been successful in using it in Firefox but cannot get it to function in Chrome or Safari.</p>
  
  <p>It appears to only function in Firefox when its used in the body:</p>
  
  <pre><code>&lt;body onafterprint="printIt()"&gt;
  </code></pre>
  
  <p>The script for the function is this:</p>
  
  <pre><code>$(document).ready(function() {
  $('.printMe').click(function() {
      window.print();
      return false;
  });
   });
  
  function printIt()
  {
  $('#confirmPrint').show();
  };
  </code></pre>
  
  <p>By clicking the <code>.printMe</code> button, it opens the print window.  Clicking print or cancel will show a message in <code>#confirmPrint</code>.  I'm not so worried about being able to tell whether they are clicking cancel or print. I am only concerned with it functioning in Chrome and Safari.  Any help is much appreciated.  I am using jQuery as well, if that is not already obvious.</p>