Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Client Scripting
Expertise: Beginner
Oct 22, 1999

Closing the User's Browser Window

Question:
I want to close the window that opened a new window using window.opener.close().The problem is when this code is executed, some confirmation message pops up. Is there any way to stop this message from appearing in my window?

Answer:
This is by design and you can't change it. The idea being that closing the user's browser window is impolite and they should have the opportunity to intervene. One additional thing to note is that the window.close() behavior also varies from browser to browser and between browser versions. This means that while one kind of browser will display a confirmation dialog to the user (like the one you mention), others may not.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date