Is there a way to tell when the user closes the browser that doesn't
also happen when a page is merely being refreshed?
Thanks,
Targus 8 2588
<ds******@hotmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com... Is there a way to tell when the user closes the browser that doesn't also happen when a page is merely being refreshed?
In the first place, you can't tell when the user closes the browser on
Opera and, reportedly, Safari. The Opera web site claims this is a
feature rather than a bug, although some of us disagree.
Warren Sarle said the following on 5/8/2006 9:07 PM: <ds******@hotmail.com> wrote in message news:11**********************@j33g2000cwa.googlegr oups.com... Is there a way to tell when the user closes the browser that doesn't also happen when a page is merely being refreshed? In the first place, you can't tell when the user closes the browser on Opera and, reportedly, Safari.
Nor in IE, Firefox, Mozilla or any other browser.
The Opera web site claims this is a feature rather than a bug, although some of us disagree.
Who is "us" that you refer to? Not being able to tell that the browser
closed isn't a bug. Unless there is some reason to differentiate between
navigating away and closing the browser, there is no need to even know that.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Warren Sarle wrote: <ds******@hotmail.com> wrote in message news:11**********************@j33g2000cwa.googlegr oups.com... Is there a way to tell when the user closes the browser that doesn't also happen when a page is merely being refreshed?
In the first place, you can't tell when the user closes the browser on Opera and, reportedly, Safari. The Opera web site claims this is a feature rather than a bug, although some of us disagree.
And in the second place, bugs result from programming errors. A feature
that works as designed isn't a bug - if it works contrary to expectation
or an individuals' particular requirements, it might be called an
annoyance but it is not a bug. :-)
--
Rob
Group FAQ: <URL:http://www.jibbering.com/faq/>
"Randy Webb" <Hi************@aol.com> wrote in message
news:U8********************@comcast.com... Warren Sarle said the following on 5/8/2006 9:07 PM: <ds******@hotmail.com> wrote in message news:11**********************@j33g2000cwa.googlegr oups.com... Is there a way to tell when the user closes the browser that doesn't also happen when a page is merely being refreshed?
In the first place, you can't tell when the user closes the browser on Opera and, reportedly, Safari.
Nor in IE, Firefox, Mozilla or any other browser.
IE and Firefox trigger an unload event when the user closes the browser.
Opera does not trigger any event when the user closes the browser.
Warren Sarle said the following on 5/9/2006 12:04 AM: "Randy Webb" <Hi************@aol.com> wrote in message news:U8********************@comcast.com... Warren Sarle said the following on 5/8/2006 9:07 PM: <ds******@hotmail.com> wrote in message news:11**********************@j33g2000cwa.googlegr oups.com... Is there a way to tell when the user closes the browser that doesn't also happen when a page is merely being refreshed? In the first place, you can't tell when the user closes the browser on Opera and, reportedly, Safari. Nor in IE, Firefox, Mozilla or any other browser.
IE and Firefox trigger an unload event when the user closes the browser. Opera does not trigger any event when the user closes the browser.
IE and Firefox also trigger that same exact unload event when you do any
of the following:
Click a Favorites to navigate away
Type a URL into the Address Bar and click Go
Click the Home button
And that is just three, there are more.
You have *no way* of knowing whether I closed the browser or did one of
the three above so it is *impossible* to tell if I "closed the browser"
or not, only that the page itself was unloaded. And that is true in
*any* browser.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
In article <bv******************************@comcast.com>,
Randy Webb <Hi************@aol.com> writes: Warren Sarle said the following on 5/9/2006 12:04 AM: "Randy Webb" <Hi************@aol.com> wrote in message news:U8********************@comcast.com... Warren Sarle said the following on 5/8/2006 9:07 PM: <ds******@hotmail.com> wrote in message news:11**********************@j33g2000cwa.googlegr oups.com... > Is there a way to tell when the user closes the browser that doesn't > also happen when a page is merely being refreshed? In the first place, you can't tell when the user closes the browser on Opera and, reportedly, Safari. Nor in IE, Firefox, Mozilla or any other browser.
IE and Firefox trigger an unload event when the user closes the browser. Opera does not trigger any event when the user closes the browser.
IE and Firefox also trigger that same exact unload event when you do any of the following:
Click a Favorites to navigate away Type a URL into the Address Bar and click Go Click the Home button
And that is just three, there are more.
You have *no way* of knowing whether I closed the browser or did one of the three above so it is *impossible* to tell if I "closed the browser" or not, only that the page itself was unloaded. And that is true in *any* browser.
No, you can't tell if the page was unloaded in Opera or Safari.
The original poster apparently wanted to know if there is an event
that:
1) fires when the browser is closed, and
2) does not fire when the page is refreshed.
My point was that there is no event that satisfies (1) on all
browsers, much less both (1) and (2).
--
Warren S. Sarle SAS Institute Inc. The opinions expressed here sa****@unx.sas.com SAS Campus Drive are mine and not necessarily
(919) 677-8000 Cary, NC 27513, USA those of SAS Institute.
Warren Sarle said the following on 5/9/2006 2:10 PM: In article <bv******************************@comcast.com>, Randy Webb <Hi************@aol.com> writes: Warren Sarle said the following on 5/9/2006 12:04 AM: "Randy Webb" <Hi************@aol.com> wrote in message news:U8********************@comcast.com... Warren Sarle said the following on 5/8/2006 9:07 PM: > <ds******@hotmail.com> wrote in message > news:11**********************@j33g2000cwa.googlegr oups.com... >> Is there a way to tell when the user closes the browser that doesn't >> also happen when a page is merely being refreshed? > In the first place, you can't tell when the user closes the browser on > Opera and, reportedly, Safari. Nor in IE, Firefox, Mozilla or any other browser. IE and Firefox trigger an unload event when the user closes the browser. Opera does not trigger any event when the user closes the browser. IE and Firefox also trigger that same exact unload event when you do any of the following:
Click a Favorites to navigate away Type a URL into the Address Bar and click Go Click the Home button
And that is just three, there are more.
You have *no way* of knowing whether I closed the browser or did one of the three above so it is *impossible* to tell if I "closed the browser" or not, only that the page itself was unloaded. And that is true in *any* browser.
No, you can't tell if the page was unloaded in Opera or Safari.
The original poster apparently wanted to know if there is an event that: 1) fires when the browser is closed, and 2) does not fire when the page is refreshed.
My point was that there is no event that satisfies (1) on all browsers, much less both (1) and (2).
And my point is that there is no browser that satisfies (1) in *any*
situation so (2) is moot.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: hawkon |
last post by:
Hi all,
I have an important question to ask about how to trap events when the user
close the browser window.
I'm a ASP programmer and I have s MSSQL database with a user table where I'm able to...
|
by: Daniel |
last post by:
Is there a way to make a javascript do something when the user closes the
browser? I would like it to go another url or something.
I do not want this script to run when a user clicks on a link on...
|
by: jb61264 |
last post by:
Is it possible to refresh a parent browser window when a "child"
browser window has been closed using the button in the upper right
corner of the browser?
When I refer to child window, I mean...
|
by: Derek |
last post by:
Hello:
I want to capture the event when a browser is closing, to give to the user
the posibility of close or no this browser. When the browser is closing,
this show a confirm window with two...
|
by: Michel |
last post by:
Yes, there is a way of forbidding a form being closed if you create a
boolean variable (blnCanClose = False) in the form's Unload event. I
didn't read all the responses, but I have just such a form...
|
by: Chirag Malvi |
last post by:
hello all,
I am developing the web application using ASP.net and VS.2003 IDE.
here is the situation which i want to implement.
1) User is browsing some webform. I want to trap this event....
|
by: karthik juneni |
last post by:
Hi all,
Iam trying to capture windows closing event (i.e) when the user clicks
on the "X" button i want to capture that event and want to update some
values in the database.I tried two methods...
|
by: sbettadpur |
last post by:
Hi,
Please help me,
Here i have a problem
When i am trying to close the main browser i need to popup a confirmation window
actually i had a code that is working on IE browser with some...
|
by: bnashenas1984 |
last post by:
Hi everyone
I'v seen several websites doing what I'm asking now but I don't know how they do it.
Lets say we have an E-commerce website that has a shopping cart inside an IFrame which shows what...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |