<%@ page language="java" %> <%@ page contentType="text/html; charset=gb2312"%> <%@ taglib prefix="s" uri="/struts-tags"%> <%@ page import="java.util.*" %> <html> <head> </head> <script type="text/javascript" src="../resources/gal/js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="../resources/gal/js/jquery.PrintArea.js"></script> <script type="text/javascript"> function printarea(){ alert("测试打印"); $("#order").printArea(); } </script> <body> <s:form id="order" name="orderForm" method="post" theme="simple" action="addOrderAction" namespace="/order"> 打印内容 </s:form> <input type="button" name="print" onclick="printarea()" value="打印"> </body> </html>
query.PrintArea.js 和jquery-1.4.2.min.js可自行下载