Click to See Complete Forum and Search --> : Trying to eliminate "Are you sure you want to close Window" Message


clyde
07-27-2005, 08:31 AM
Hello Anybody

Below is the simple code used to close the Window on IE 6.0

Is there any way to eliminate the the alert "Are you sure you want to Close This Window"

When the user clicks on my defined button that executes the function below,
He knows he wants to close the window. Can I eliminate the alert Box.


function hback()
{
window.close();
}

Any help Appreciated
Clyde

LeeU
07-27-2005, 08:52 AM
According to Danny Goodman, "JavaScript Bible":

"While I'm on the subject of closing windows, a special case exists when a subwindow tries to close the main window (via a statement such as self.opener.close()) when the main window has more than one entry in its session history. As a safety precaution against scripts closing windows they did not create, modern browsers ask the user whether he or she wants the main window to close (via a browser-generated dialog box). This security precaution cannot be overridden except in NN4+/Moz via a signed script when the user grants permission to control the browser."

clyde
07-27-2005, 09:05 AM
I was not sure.

Never no till you ask.