如何在IE11中进行打印预览 [英] How to do print preview in IE11

查看:133
本文介绍了如何在IE11中进行打印预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,



我试图在我的asp .net应用程序中使用javascript进行打印预览。

我的javascript就像这样。



函数PrintPanel()

{

var panel = document.getElementById(<%= div_print.ClientID%>);

var printWindow = window.open('','','height = 800,width = 800');



printWindow.document.write('< html>< head>< title>< / title>');

printWindow.document.write('< ; / head>< body>');

printWindow.document.write(panel.innerHTML);

printWindow.document.write('< / body> ;< / html>');

printWindow.document.close();



printWindow.document.close();

setTimeout(function(){

printWindow.focus();

printWindow.print();



},500);

返回false;

}



--------------------------

但在IE11中我收到一个错误,比如



JavaScript运行时错误:无法获取未定义或空引用的属性'document'

在其他浏览器中运行很好。



任何人都可以帮我解决这个问题。???

提前谢谢

(Keerthi Kumar)

Hi experts,

Am trying to do print preview using javascript in my asp .net application.
my javascript is like this.

function PrintPanel()
{
var panel = document.getElementById("<%=div_print.ClientID %>");
var printWindow = window.open('', '', 'height=800,width=800');

printWindow.document.write('<html><head><title></title>');
printWindow.document.write('</head><body >');
printWindow.document.write(panel.innerHTML);
printWindow.document.write('</body></html>');
printWindow.document.close();

printWindow.document.close();
setTimeout(function() {
printWindow.focus();
printWindow.print();

}, 500);
return false;
}

--------------------------
but in IE11 am getting a error like

JavaScript runtime error: Unable to get property 'document' of undefined or null reference
in other browsers its working fine.

can any one please help me solve this issue.???
thanks in advance
(Keerthi Kumar)

推荐答案

通过以下链接: http://stackoverflow.com/questions/2603465/using-jquery-to-open-a-popup-window-and-print [ ^ ] < br $> b $ b

http://tuljo.com/web-development/print-popup-window-javascript [ ^ ]
Go through this link : http://stackoverflow.com/questions/2603465/using-jquery-to-open-a-popup-window-and-print[^]

http://tuljo.com/web-development/print-popup-window-javascript[^]


这篇关于如何在IE11中进行打印预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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