Project also want to use this function, found error, after testing, must add <object id= "WebBrowser" width=0 height=0 classid= "CLSID : 8856F961-340A-11D0-A96B-00C04FD705A2 ">
</object> this sentence is OK!!
------The following content is available online
In the page is not JS open to press Window.close (), there will be a prompt box, very annoying, now can not use, no prompt box directly close the window.
Try the following code:
<object id= "WebBrowser" width=0 height=0 classid= "CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" >
</object>
<input type= "button" name= "button" value= "Close Window" onclick= "Document.all.WebBrowser.ExecWB (45,1)" >
Trying to change the parameters will give you some additional features:
WEBBROWSER.EXECWB (*) Open
WEBBROWSER.EXECWB (2,1) Close all IE windows now and open a new window
WEBBROWSER.EXECWB (4,1) Save Web page
WEBBROWSER.EXECWB (6,1) printing
WEBBROWSER.EXECWB (7,1) Print preview
WEBBROWSER.EXECWB (8,1) print Page Setup
WEBBROWSER.EXECWB (10,1) view page Properties
WEBBROWSER.EXECWB (15,1) seems to be withdrawn, pending confirmation.
WEBBROWSER.EXECWB (17,1) Select all
WEBBROWSER.EXECWB (22,1) Refresh
WEBBROWSER.EXECWB (45,1) Close the form without prompting
These are only valid for IE5.5 and above, I was tested under IE6, passed.