title: What does the Primefaces printer.js Do?
body: <p>I am new To JQuery and Primefaces.</p>
  
  <p>The Below Code(printer.js) is used in Primefaces for Printing the desired Target <code>&lt;p:printer target="targetId"&gt;</code></p>
  
  <p>I am trying to Print the content of a Primefaces Panel which is inside a Dialog Box, it is working fine in IE8 and other browsers, but in IE9 and above it is throwing an Error as <code>"Internet Stopped Working"</code> </p>
  
  <pre><code>How can i Fix this issue ? Can any one Explain what Does that printer.js Do ?
  </code></pre>
  
  <p><strong>printer.js</strong></p>
  
  <pre><code> (function(b){var a;
                      b.fn.jqprint=function(d){a=b.extend({},b.fn.jqprint.defaults,d);
                      var c=(this instanceof jQuery)?this:b(this);
                          if(a.operaSupport&amp;&amp;b.browser.opera){
                              var e=window.open("","jqPrint-preview");
                                  e.document.open();
                                  var g=e.document
                          }else{
                              var f=b("&lt;iframe  /&gt;");
                              if(!a.debug){
                                  f.css({position:"absolute",width:"0px",height:"0px",left:"-600px",top:"-600px"})
                              }
                              f.appendTo("body");
                              var g=f[0].contentWindow.document
                          }
                          if(a.importCSS){
                              if(b("link[media=print]").length&gt;0){
                                  b("link[media=print]").each(function(){g.write("&lt;link type='text/css' rel='stylesheet' href='"+b(this).attr("href")+"' media='print' /&gt;")})
                              }else{
                                  b("link").each(function(){g.write("&lt;link type='text/css' rel='stylesheet' href='"+b(this).attr("href")+"' /&gt;")})\
                                  }
                          }
                          if(a.printContainer){
                              g.write(c.outer())
                          }else{
                              c.each(function(){g.write(b(this).html())})
                          }g.close();
                          (a.operaSupport&amp;&amp;b.browser.opera?e:f[0].contentWindow).focus();setTimeout(function(){(a.operaSupport&amp;&amp;b.browser.opera?e:f[0].contentWindow).print();if(e){e.close()}},1000)
                      };
                      b.fn.jqprint.defaults={debug:false,importCSS:true,printContainer:true,operaSupport:true};
                      jQuery.fn.outer=function(){return b(b("&lt;div&gt;&lt;/div&gt;").html(this.clone())).html()}
                  })(jQuery);
  </code></pre>