Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How can i know when user clicks X button of the browser ?

Reply
Thread Tools

How can i know when user clicks X button of the browser ?

 
 
Asit
Guest
Posts: n/a
 
      04-26-2004
How can i know when user clicks X button of the browser ?
I have to write some code when user clicks X button of browser. What is the
event for capturing this event ?

Help needed ASAP.

Asit
 
Reply With Quote
 
 
 
 
Michael Winter
Guest
Posts: n/a
 
      04-26-2004
On 25 Apr 2004 21:08:11 -0700, Asit <> wrote:

> How can i know when user clicks X button of the browser ?


The unload event fires when the document unloads, but a document can
unload for many things not just closing. Furthermore, some browsers don't
fire the unload event during closing, which makes it an even more
unreliable approach.

> I have to write some code when user clicks X button of browser. What is
> the event for capturing this event ?


If the user is closing their browser, it is generally too late for you to
be doing anything. What are you trying to accomplish? There might be an
alternate way.

Mike

--
Michael Winter
d (replace ".invalid" with ".uk" to reply)
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      05-05-2004
Asit wrote:

> How can i know when user clicks X button of the browser ?


You cannot.

> I have to write some code when user clicks X button of browser.


You don't have to.

> What is the event for capturing this event ?


There is no standard compliant one that works cross-browser.

> Help needed ASAP.


Refactor your server-side application, if you use any; do
not nag your users, if you do not. The latter is illegal.


PointedEars
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Getting event when user clicks X in browser, something different from {before}bodyunload hemant.singh@gmail.com Javascript 6 09-05-2006 06:07 AM
Absolutely strange inconsistent behavior occuring when a user clicks an ASP.NET button. Mossman ASP .Net 1 12-12-2005 04:44 AM
vbscript msgbox confirmation when user clicks Cancel button Bucky ASP .Net 1 05-19-2005 09:17 PM
Clicks and double-clicks PontiMax ASP .Net Datagrid Control 2 07-14-2004 11:00 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57