In Ie7/firefox 3.0/google Chrome passed the test
Closedemo.htm
Copy Code code as follows:
<script>
var browsername=navigator.appname;
if (browsername== "Netscape")
{
function Closeme ()
{
window.open (', ' _parent ', ');
Window.close ();
}
}
Else
{
if (browsername== "Microsoft Internet Explorer")
{
function Closynoshowsme ()
{
Window.opener = "Whocares";
Window.close ();
}
}
}
</script>
<input type= "button" value= "Close me 3" onclick= "Closeme ();" />
Attention
If you are using a Firefox browser you must make the following settings
1, in the Address bar input about:config and then enter, warning confirmation
2, enter "Dom.allow_scripts_to_close_windows" in the filter, double-click to set this value to True
can be completed.
Test comparison good code: feel netizens reply
<script type= "Text/javascript" > Function Closeme () {var browsername=navigator.appname; if (browsername==) Netscape ") {window.open (', ' _parent ', '); Window.close ();} else if (browsername==" Microsoft Internet Explorer ") {Windo W.opener = "Whocares"; Window.close (); } </script> <input type= "button" value= "Close me 3" onclick= "Closeme ();" />
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]