title: window.print() not working in Firefox
body: <p>I have the following js code:</p>
  
  <pre><code> window.print();
  </code></pre>
  
  <p>This works in Chrome and IE. It also works on iPhone safari. However, it does not work on Firefox.</p>
  
  <p>The following does work in Firefox</p>
  
  <pre><code>alert()
  window.print();
  </code></pre>
  
  <p>so I figure it's some kind of timing thing?  Note that my js code only loads after the page itself has been loaded:</p>
  
  <pre><code> function loadJS() {     
        var element = document.createElement("script"); // 
        element.src = "url/js/all.js";
        document.body.appendChild(element);    
   }
  
  if (window.addEventListener)
        window.addEventListener("load", loadJS, false);
  else if (window.attachEvent)
      window.attachEvent("onload", loadJS);
  else 
     window.onload = loadJS;
  </code></pre>