我有一个div类: -打印的div元素类
<div class="hidden">
This is it.
<asp:Button ID="Button1" runat="server"
Height="23px" style="margin-top: 0px" Width="69px" text="Print" OnClientClick="PrintElem('#hidden'); return false;"/>
</div>
这个div类中,动态填充的元素列表。 我想在这个div类中使用打印按钮来打印所有元素。
function PrintElem(elem) {
Popup($(elem).html());
}
function Popup(data) {
var mywindow = window.open('', '#hidden', 'height=400,width=600');
mywindow.document.write('<html><head><title>Pharmacy List</title>');
/*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
mywindow.document.write('</head><body >');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
mywindow.print();
mywindow.close();
return true;
}
除了打印出来是空白的,标题为“未定义”的页面这个伟大的工程。
但是这对IE不起作用?有任何想法吗?? – Philo