Description
This script/hack can be used to close windows that have not been opened with JavaScript with out causing an alert.
Demonstration
Close this non-javascript opened window with no alerts.
Code
<script type="text/javascript"> function closewin() { opener = self; window.close(); } </script> </head> <body> <p><a href="#" onclick="closewin(); return false;">Close</a></p>
Tested in: IE6, Opera 7, NN4.7, NN7, and Mozilla 1.2.
Works in: IE6, NN4.7, NN7, and Mozilla 1.2.
Doesn't work in: Opera 7
In Opera 7, it closes the page you are viewing, but does not close the browser.
Copyright© 2003, Infinity Web Design