Note If you are using the firefox browser, you must make the following settings 1. Enter about:config in the address bar Then press Enter and confirm the warning 2. Enter "dom.allow_scripts_to_close_windows" in the filter, double-click to set this value to true and you are done.
js closing window is compatible with firefox, chrome, and ie
The above setInterval('closeme()',3000); is to delay closing for 3 seconds. If you don't want to delay, you can directly replace it with closeme (); that’s it. JavaScript silently closes the window (compatible with IE/Firefox/Chrome) The first one below is the actual code, which is pretty good and recommended. But ie compatibility is not good
Second: Code only for ie7 ie8 ie6 javascript silent window closing script
[Ctrl A select all Note:
If you need to introduce external Js, you need to refresh to execute ]<script>
function CloseWin(){
window.opener=null;
window.open('','_self');
window.close();
}
</script> Note " If you are using the firefox browser, you must make the following settings 1. Enter about:config in the address bar and press Enter to confirm the warning 2. Enter "dom.allow_scripts_to_close_windows" in the filter and double-click to set this value to true That's it But some of the things are still worthy of reference by friends who want to go deeper. Try the following code:
Try changing the parameters and you will get some other functions:
WebBrowser.ExecWB(1,1) Open WebBrowser.ExecWB(2,1) Close all now IE window and open a new window WebBrowser.ExecWB(4,1) Save web page 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(15,1) It seems to be revoked and needs to be confirmed WebBrowser.ExecWB(17, 1) Select all WebBrowser.ExecWB(22,1) Refresh WebBrowser.ExecWB(45,1) Close the form silently
These are only valid for IE5.5 or above. I am It was tested under IE6 and passed.
When you press window.close() on a page that is not opened with js, there will be a prompt box, which is very annoying. You can no longer use it. You can close it directly without the prompt box. Window.
Someone has posted a silent window using IE5.5/6.0 vulnerability,
But then IE6.0 came out with a patch and it became invalid
Now there is a very simple code to close the window silently as follows:
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn