dwcc如何做网站/网络软文发布
http://wenku.baidu.com/view/060cdd1b964bcf84b9d57b41.html
http://phl.iteye.com/blog/825110
本文实现了jquery1.4.3对div打印。
实现步骤1)引用2个js文件
2)定义打印区域的div,打印按钮
3)为打印按钮绑定打印事件
代码如下:
<%@ page import="java.util.*"%>
<html>
<head>
<title></title>
</head>
<script type="text/javascript" src="jquery-1.4.3.js"></script>
<script type="text/javascript" src="jquery.PrintArea.js"></script>
<body>
<input id="btnPrint" type="button" value="打印"/>
<div id="myPrintArea">
====打印区域====
</div>
</body>
<script type="text/javascript">
$(function(){
//打印
$("#btnPrint").bind("click",function(event){
$("#myPrintArea").printArea();
});
});
</script>
</html>