asp实现打印功能

 时间:2024-10-11 23:13:39

1、加入如下代码在</head>标签前<script language=javascript>function preview() { bdhtml=window.document.body.innerHTML; sprnstr="<!--startprint-->"; eprnstr="<!--endprint-->"; prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17); prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr)); window.document.body.innerHTML=prnhtml; window.print(); window.document.body.innerHTML=bdhtml; }</script>

2、然后是body部分<!--startprint--> '打印开始这里开始是你要打印的表格的代码及数据<!--endprint--> '打印结束

3、然后打印按钮给一个onClick="preview();window.close()"

  • vivoy53s怎样清空数据?
  • 江南百景图游戏攻略
  • 妇科炎症分类及主要症状
  • 如何巧妙地去除红、紫药水污渍
  • QQ网络硬盘在哪里
  • 热门搜索
    上海旅游景点地图 三清山旅游网 怀柔旅游地图 三三旅游 扬州旅游节 重庆三日游旅游攻略 大纵湖旅游度假区 福州的旅游景点 旅游年票景点 江西三清山旅游