js window.open 然后打印() [英] js window.open then print()

查看:38
本文介绍了js window.open 然后打印()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

print() 在打开新窗口后在 IE 中不起作用.它适用于 Chrome.这是一个测试人员:

print() doesn't work in IE after opening a new window. It works in Chrome. Here's a tester:

<html>
<head>
<script type="text/javascript">
  function openWin()
  {
    myWindow=window.open('','','width=200,height=100');
    myWindow.document.write("<p>This is 'myWindow'</p>");
    myWindow.focus();
    myWindow.print(); //DOES NOT WORK
  }
</script>
</head>
<body>

<input type="button" value="Open window" onclick="openWin()" />

</body>
</html>

推荐答案

checkout:window.print() 在 IE 中不起作用

工作样本:http://jsfiddle.net/Q5Xc9/1/

这篇关于js window.open 然后打印()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆