If you press window. Close () on a page that is not opened by JS, there will be a prompt box, which is annoying. Now you don't need it. Close the window without a prompt box.
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)">
If you try to change the parameters, you will get some other functions:
Webbrowser. execwb () Open
Webbrowser. execwb () Close all existing IE Windows and open a new window
Webbrowser. execwb () Save the webpage
Webbrowser. execwb (6, 1) print
Webbrowser. execwb (7,1) print preview
Webbrowser. execwb (8, 1) print page settings
Webbrowser. execwb (10, 1) view page properties
Webbrowser. execwb () seems to be undo, to be confirmed
Select All webbrowser. execwb (17,1)
Webbrowser. execwb (22, 1) Refresh
Webbrowser. execwb () Close form no prompt
Another method is to close the window without prompting:
<Input type = "button" value = "the message" onclick = "window. Opener = NULL; window. Close ();"/>
Supplement:
The same statement is normal in IE6. In IE7, the prompt before closing the window is displayed.
This code is very simple. Please use it:
<A href = "#" onclick = "window. opener = NULL; window. open ('', '_ Self'); window. close (); "> close not confirmed </a>
That is, add window. Open ('', '_ Self') between window. Opener = NULL; window. Close ');
OK!