We know that the direct use of Window.close () is a shutdown prompt, the user experience is compromised,
Solving method
When the child window calls Window.close (), the dialog box will not pop up, so as long as the window is set to a pseudo parent window, IE will take the current window as a child window
The code is as follows
With Window.opener = NULL, you can
The code is as follows |
Copy Code |
Do not prompt the window to close the dialog box Parent.window.opener = null; Parent.window.open ("", "_self"); Parent.window.close (); Parent.window.location.href = ""; Window.close (); |
Other methods
code is as follows |
copy code |
//normal with prompt close function Closeie () { Window.close (); } //Close IE6 not prompt function closeie6 () { Window.opener=null; Window.close (); } //Close IE7 not prompt function closeie7 () { window.open (', ' _top '); Window.top.close (); } |