zwei1121

博客园 首页 新随笔 联系 订阅 管理

<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>

posted on 2014-08-18 11:30  zwei  阅读(149)  评论(0编辑  收藏  举报