Printing Opera window.close不会在window.print之后启动/执行;“打印”;在打印机选择对话框中单击
这个问题只与歌剧有关。其他浏览器也可以:- 使用JavaScript,我创建了一个新窗口,写入文档,然后在窗口对象上调用print和close。 执行打印功能并弹出打印机选择对话框后,如果用户单击“取消”,则执行关闭功能并关闭窗口。但是,如果用户单击“打印”,文档将打印,但窗口不会关闭 这是JS小提琴Printing Opera window.close不会在window.print之后启动/执行;“打印”;在打印机选择对话框中单击,printing,window,opera,Printing,Window,Opera,这个问题只与歌剧有关。其他浏览器也可以:- 使用JavaScript,我创建了一个新窗口,写入文档,然后在窗口对象上调用print和close。 执行打印功能并弹出打印机选择对话框后,如果用户单击“取消”,则执行关闭功能并关闭窗口。但是,如果用户单击“打印”,文档将打印,但窗口不会关闭 这是JS小提琴 http://jsfiddle.net/HEaFP/ 这是我正在使用的代码 var ic_hic_demo_window = window.open("", "", "toolbar=no, s
http://jsfiddle.net/HEaFP/
这是我正在使用的代码
var ic_hic_demo_window = window.open("", "", "toolbar=no, status=no, directories=no, menubar=no, titlebar=no, location=no, scrollbars=no, resizable=no, height=500, width=500, left=10, top=10");
ic_hic_demo_window.document.open();
ic_hic_demo_window.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><title></title>');
ic_hic_demo_window.document.write('</head><body style="font-family: tahoma, arial, verdana; font-size: 11px" onload="print();close();">');
ic_hic_demo_window.document.write("Some sample text");
ic_hic_demo_window.document.write("</body></html>");
ic_hic_demo_window.document.close();
var ic_hic_demo_window=window.open(“,”,“toolbar=no,status=no,directories=no,menubar=no,titlebar=no,location=no,scrollbars=no,resizeable=no,height=500,width=500,left=10,top=10”);
ic_hic_demo_window.document.open();
ic_hic_demo_window.document.write(“”);
ic_hic_demo_window.document.write(“”);
ic_hic_demo_window.document.write(“一些示例文本”);
ic\u hic\u demo\u window.document.write(“”);
ic_hic_demo_window.document.close();
非常感谢您的帮助……好吧。。如果正在从窗口打印,我想忽略关闭窗口的命令是有意义的,不是吗?你试过做类似的事情吗
onload="print();setInterval(function(){close();}, 500)"
- 这个想法是,脚本每半秒都会尝试关闭一次窗口,直到它工作为止