1》 //button点击实现调用函数
function printTabel()
{var mStr;
mStr = window.document.body.innerHTML;
var mWindow = window;
window.document.body.innerHTML =document.getElementById("mainbody").innerHTML;
mWindow.print();
window.document.body.innerHTML = mStr;
}
2》全局打印效果实现:<INPUT οnclick='javascript:window.print()' type="button" value="打印 " style="color: blue"> 实现打印全部的html页面效果。 ///已测试
3》IE调用底层代码: <object ID='WebBrowser' WIDTH=0 HEIGHT=0CLASSID='CLSID:8856F961-340A-11D0-A96B-00C04FD705A2'></object>WebBrowser1.ExecWB(6,1); 实现打印功能,没有通过测试实现