- <html >
- <head runat="server">
- <title>无标题页</title>
- <script type="text/javascript">
- function printdiv()
- {
- var headstr = "<html><head></head><body>";
- var footstr = "</body>";
- var newstr = document.getElementById("YesPrint").innerHTML;
- var oldstr = document.body.innerHTML;
- document.body.innerHTML = headstr+newstr+footstr;
- window.print();
- document.body.innerHTML = oldstr;
- return false;
- }
-
- function okPrint()
- {
- if (confirm("您确定要打印成文档吗?")==true)
- {
- printdiv();
- }
- else
- {
- window.close();
- }
- }
- </script>
- </head>
- <body>
- <div id="divMain" >
- <div id="YesPrint">
- 这里是需要打印的信息自己可以根据需要自己设计!!!
- </div>
- <div id="trbtn">
- <table>
- <tr>
- <td >
- <input id="btnSave" type="button" value="打印" class="button" onclick="okPrint();" />
- </td>
- </tr>
- </table>
- </div>
- </div>
-
- </body>
- </html>
posted @
2010-02-11 11:05
Look_Sun
阅读(
1032)
评论()
编辑
收藏
举报