码迷,mamicode.com
首页 > 其他好文 > 详细

打印print

时间:2014-08-18 12:23:04      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:style   color   java   os   io   ar   cti   div   

<script type="text/javascript">
function printpreview() {
try {
var HKEY_Root, HKEY_Path, HKEY_Key;
HKEY_Root = "HKEY_CURRENT_USER";
HKEY_Path = "\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
var Wsh = new ActiveXObject("WScript.Shell");
HKEY_Key = "header";
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");
HKEY_Key = "footer";
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");
}
catch (e) {
}
}
function printerDiv(printpage) {

var headstr = "<html><head><title></title></head><body>";
var footstr = "</body>";
var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr + newstr + footstr;
window.print();
document.body.innerHTML = oldstr;
printpreview();
return;
}
</script>
<div class="main_content">
<div class="bread_crumbs">
<a href="#"><span class="home_icon"></span>首页</a>&nbsp; > &nbsp;<label>订单管理</label></div>
<div style="margin-top: 20px; margin-left: 20px; font-size: 20px; color: Black; font-weight: bold;">
<a onclick="printerDiv(‘content‘)" style="cursor: hand; cursor: pointer;">打 印 </a>
</div>

打印print,布布扣,bubuko.com

打印print

标签:style   color   java   os   io   ar   cti   div   

原文地址:http://www.cnblogs.com/zwei1121/p/3919137.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!