parent:
<input type="button" name="parent" value="parent" onclick="window.open('child.html')" />
child:
<object id="WebBrowser" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>
<input type="button" name="print" value="print" onclick="document.all.WebBrowser.ExecWB(7,1);" />
<input type="button" name="child" value="child" onclick='document.write("<script>window.close();<\/script>");' />
按下打印后,如果直接用window.close()不能关闭,原因不是很清除,可以用document.write代替
<input type="button" name="parent" value="parent" onclick="window.open('child.html')" />
child:
<object id="WebBrowser" height="0" width="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>
<input type="button" name="print" value="print" onclick="document.all.WebBrowser.ExecWB(7,1);" />
<input type="button" name="child" value="child" onclick='document.write("<script>window.close();<\/script>");' />
按下打印后,如果直接用window.close()不能关闭,原因不是很清除,可以用document.write代替