posted on Thursday, June 17, 2004 3:28 PM
by
leon
Close current browser window
Another couple of common questions:
1. How can we make URL open in window with specific parameters (no toolbar for example)?
2. How can we close current window, without getting annoying alert: "The Web page you are viewing is trying to close the window"?
Basically it is the same question. We can build auxiliary HTML page that uses window.open() with requested parameters to open real URL as needed, and than closes itself. And just to keep browser happy, let him think that script, which asking to close window belongs to its opener. Here is your loader.htm:
<script>
window.open("RealURL.htm", null, "height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
window.opener = window;
window.close();
</script>