日期:2014-05-16 浏览次数:20405 次
function printInfo() { var printId = document.getElementById("print"); var mStr = window.document.body.innerHTML ; window.document.body.innerHTML =printId.innerHTML; window.print(); window.document.body.innerHTML = mStr; } function printView() { //打印预览 var wb = document.getElementById('wb'); wb.ExecWB(7,1); }
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" id="wb" name="wb" width="0"></OBJECT> <div id="printDiv">需要打印的内容</div>