PDA

View Full Version : Close Window


ssskaya
03-14-2003, 11:38 AM
I am using the script below to provide a "close window" link on my pop-up page:

<a href="javascript:window.close();">Close This Window</a>

When the link is clicked, it asks the user "Do you want to close the window?"

How can I aviod that?

Thanks!

requestcode
03-14-2003, 01:47 PM
You can't. It is a built in security feature that keeps someone from shutting down the browser without the individuals permission.

Adam20002
03-14-2003, 04:51 PM
requestcode - This should only happen when trying to close the main browser window shouldn't it ? In this case it is a pop up that needs closing. I have closed pop up windows in this manner without getting a message.

Adam

Spudhead
03-14-2003, 05:08 PM
How was the window opened? Via a link with target="_blank" or similar? The security alert will appear for any window that wasn't opened via scripting.

beetle
03-14-2003, 05:25 PM
There's a hack (http://aspalliance.com/peterbrunone/impossible.asp) for this.