在ASP.NET2.0里打印网页指定的内容(比如打印网页里的一个Table)
时间:2014-04-28 11:40:15
收藏:0
阅读:942
原文:在ASP.NET2.0里打印网页指定的内容(比如打印网页里的一个Table)
打印指定内容:
<html>
<head>
<script type=
"text/javascript " language= "javascript ">
function
printPage() {
var newWin = window.open(
‘about:blank ‘, ‘ ‘, ‘ ‘);
var titleHTML =
document.getElementById( "doctitle ").innerHTML;
newWin.document.write(titleHTML);
newWin.document.location.reload();
newWin.print();
}
</script>
</head>
<body>
<div id= "doctitle ">
要打印的内容!
</div>
<a href= "javascript:; " onclick=
"printPage() "> 打印 </a>
</body>
</html>
评论(0)