如何在showModalDialog的页面里~~ 实现打印功能~~~~
function print(){
//alert()
//document.all.WebBrowser.printing.portrait=false;
document.all.WebBrowser.ExecWB(6,6)
}
function pageSet(){
document.all.WebBrowser.ExecWB(8,1)
}
function printView(){
document.all.WebBrowser.ExecWB(7,1)
}
=.=!!! 页面
<object id="WebBrowser" name="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" width="0"> </object>
但是出错:
提示:不支持该命令。
function print(){
//alert()
//document.all.WebBrowser.printing.portrait=false;
document.all.WebBrowser.ExecWB(6,6)
}
function pageSet(){
document.all.WebBrowser.ExecWB(8,1)
}
function printView(){
document.all.WebBrowser.ExecWB(7,1)
}
=.=!!! 页面
<object id="WebBrowser" name="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" width="0"> </object>
但是出错:
提示:不支持该命令。
通过window.showModalDialog()传递给弹出来的窗口,然后再使用,就没有问题了。a.html片段:
<script>
window.onunload = function(){
alert("window.onunload");
}
function popup(){
window.showModalDialog('b.html',WebBrowser,'dialogHight:500px;dialogWidth:650px;center:yes;resizeable:no;help:no;status;no');
}
</script>
......<object id="WebBrowser" name="WebBrowser" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height="0" width="0"> </object>
被弹出的窗体b.html片段
<script>
var args=window.dialogArguments;
var wb = args;
function print(){
wb.ExecWB(6,6);
} </script>
楼上解决了这个问题了,我现在打印是没有问题,但是打印的结果不对,结果是a.htm,而不是b.htm,请问楼上有遇到这样的问题?
谢谢!