Using JS to invoke the browser's print interface is easy, one or two lines of code can be done, but some of the data is generated dynamically, such as some dynamically generated QR code, sometimes called Print interface pictures will not be displayed
To solve this problem, it is recommended to use the following library
Download: Https://github.com/tanathos/jquery.jqprint
< script src< Span class= "OP" >= "jquery.jqprint-0.3.js" /> <SCRIPT> $ ( ' #youid ' .jqprint ( { Debug:false,// If true, you can display the IFrame view effect (the IFRAME default height and width are very small, can be increased in the source code), the default is False Importcss:true,// True to introduce the original page of the CSS, the default is true Printcontainer:true,// Indicates that if the original selected object must be included in the print (note: setting to false may break your CSS rules). operasupport:true//indicates that if the plugin must also support the Opera browser, in this case it provides a temporary print tab. The default is true } ) ; </script >
JS Print html specified element, solve the dynamically acquired picture cannot print problem