BLOCKED SCRIPT How to close the browser window without the IE warning
In Internet Explorer, when you use window.close() in JavaScript to close the current browser window, you will be asked something like "A script is attempting to close this window. Do you want to continue?" As a programmer, this can be annoying if you are un-maliciously closing the window. A workaround to this would be setting the window.opener property to something else.

Example:

In your JavaScript, have something like:
function logoff() {
if (confirm("Do you want to log off?")) {
window.opener = "x";
window.close();
}
}


Then in your HTML, have a button or link that calls this JavaScript function onclick.

Read the complete post at http://alexrazon.blogspot.com/2007/01/javascript-how-to-close-browser-window.html

Published Monday, January 08, 2007 6:49 PM by Alexis' Blog