473,569 Members | 2,870 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
Jul 23 '05 #1
2 1733
On 25 Apr 2004 21:08:11 -0700, Asit <hi*****@rediff mail.com> 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
M.******@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #2
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
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4906
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST == "") { include ("InsertRecord.inc"); // Insert new record }
2
1602
by: adawson | last post by:
Hi, I need to execute some code when form submission is stopped before the page is returned from the server. For example, a user clicks a button to submit the form, realizes they've made a mistake and then clicks the browser's stop button so they can make a change before submitting the form. I need to trap the click on the stop button. ...
8
2551
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and courses are populated. When course is selected, lists of occurrences, groups and
5
1181
by: Bazza Formez | last post by:
Hi there, I am *very* new to this... so please excuse poor terminology etc. I am building a small content management system.. and have just managed to get an asp.net page up & running that edits / deleted data presented via a datagrid via a datareader. All is well, the database is updated correctly.. However after merrily doing a few...
9
1873
by: Coleen | last post by:
Hi All :-) I am desperately looking for some help/information on how to direct page flow. Forget what I have done - here's what I need to do: I have a large ASPX.Net - VB.Net web application (around 35-40 pages) that once the user logs in, I need to direct them to the correct page, depending on what they select from the directory. In...
2
3285
by: polocar | last post by:
Hi, suppose that you have a C# form with two buttons, that are the classical "btnOk" and "btnCancel" (besides them, of course in the form there can be many other controls). When the user clicks on btnOk, the program makes some confirm operations and closes the form. When the user clicks on btnCancel, the program makes some cancel operations...
3
2086
by: anthonybrough | last post by:
I have an asp page that has a form to collect user data in a form. when the user clicks submit the input is validated. If any fields are not acceptable the user clicks on a button to go back to the original form to correct the input. This all works fine until I try to incorporate a javascript to display a popup calendar which posts the...
3
1740
by: gimme_this_gimme_that | last post by:
Depending upon a radio button button's setting a div is either hidden or visible. It turns out that the default view of the page requires that the div be hidden. When the user opts for the setting that makes the div visible, clicks, and then clicks the back button the page renders with the div hidden. I've tried a few strategies to...
1
11280
by: sreedhardasi | last post by:
Hi, I would like to call a javascript function when user clicks on browser's close button. Here is the scenario. 1. User clicks browser close button. 2. User will be displayed a popup or a div with two buttons (Yes or No) by calling a Javascript function 3. "No" will close the window. 4. "Yes" will cancel the user action and redirect...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.