JavaScript - Web 列印
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>This is a Heading</h1> <p onclick="printPage()">This is a paragraph.</p> <script> function printPage() { var w = window.open(); var html = "<!DOCTYPE HTML>"; html += '<html>'; html += '<head><style></style></head>'; html += "<body onload='window.focus();window.print();window.close();'>"; html += "<img src='http://www.7-11.com.tw/event/16minions/img/minion1.png'/>"; html += "</body></html>"; w.document.write(html); w.document.close(); }; </script> </body> </html>