Using javascript to print images
问题 I would like to know if it's possible to use javascript to open a popup window containing an image, and at the same time have the print dialog show. Once someone clicks on print, the popup closes. Is this easily attainable? 回答1: popup = window.open(); popup.document.write("imagehtml"); popup.focus(); //required for IE popup.print(); 回答2: Another great solution!! All credit goes to Codescratcher <script> function ImagetoPrint(source) { return "<html><head><scri"+"pt>function step1(){\n" +