473,609 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Detect the Client Browser/Tab Closed

India777
61 New Member
Hai all,
How to Detect, the Client Closed the Browser/Tab using Javascript.
May 24 '12 #1
15 128221
Dormilich
8,658 Recognized Expert Moderator Expert
the unload & beforeunload events are fired in that case.
May 24 '12 #2
India777
61 New Member
This events also fired when i Refresh the Page. What i do?
May 24 '12 #3
Killer42
8,435 Recognized Expert Expert
Isn't reloading effectively the same as closing and reopening the page?
May 27 '12 #4
India777
61 New Member
I am only need to Find Browser/Tab Close only. Not an Reload or Refresh.I know this is not Possible Easily with Javascript.
May 28 '12 #5
Killer42
8,435 Recognized Expert Expert
I'm no expert in this area, so hopefully we can get some input from someone more knowledgeable.

But it seems likely to me that when the user refreshes the page, what happens is that the page is unloaded (triggering beforeunload and unload events), then loaded again from scratch. From the viewpoint of javascript code within that page, it would be the same as if the user closed the page then opened a fresh copy of it.

Someone please correct me if I'm off track here.
May 28 '12 #6
Dormilich
8,658 Recognized Expert Moderator Expert
you’re absolutely correct. due to the stateless nature of HTTP, there is no way for JavaScript itself to differentiate between a (user triggered) page close or reload.
May 28 '12 #7
acoder
16,027 Recognized Expert Moderator MVP
India777, why do you need to detect this and what are you trying to do?

The question you've asked has already been answered, but you're probably trying to solve something else and thought you needed to be able to detect the browser/tab closing to solve it.
May 30 '12 #8
India777
61 New Member
When the user Close his/her Browser without Logout, I need to insert the row in the table.My Application is Created using Asp.net with c#.
May 30 '12 #9
Dormilich
8,658 Recognized Expert Moderator Expert
When the user Close his/her Browser without Logout, I need to insert the row in the table
what row?
May 30 '12 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

18
2847
by: chris | last post by:
I'd like to initiate a php script using a standard httpd request, but then allow the client browser to disconnect without terminating the script. Freeing up the browser to access other functions on the site. Whilst a combination of connection_timeout() and ignore_user_abort() can stop the script from terminating when the client calls termination, i'd like to terminate the clients connection rather than having to wait for the client to...
5
27365
by: Chris Fynn | last post by:
Is there an easy way to detect the local language settings of a client browser or system? I want to for example determine if the users browser or system is set to English, French, or Italian and display a message in the appropriate language. -- Christopher J. Fynn
1
3184
by: onewebclick | last post by:
Is there a way to detect a browser cache is full using javascript or HTML thorugh a web page and inform the user to clear the cache to improve performance of the website. It looks like google's gmail use to detect and warn "Gmail says my browser's cache is full" http://gmail.google.com/support/bin/answer.py?answer=14106 then there should be a way to do it if google can do it. Any thoughts ?
7
2149
by: Chris | last post by:
Can anybody tell me how to detect is the user has closed the browser Thank you
0
1467
by: dotnettester | last post by:
Hi, I want to detect if the clients browser has cookies/javascript disabled. I know the class 'HttpBrowserCapabilities' but it gives information about the capabilities of client browser not the current settings on the browser. Would I have to do it the hard way? (Attach cookiey and detect on another page?)
0
1675
by: sahaja108 | last post by:
Hello. I was wondering if it possible to detect a Browser Back/Forward by PHP. I mean. I am in page A, I go to page B and then I click on the Back button and I return to A. Does it exist a php function that detect that I have used the Back button? Thank you very much
11
4118
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, I have an aplication web asp.net 2.0 and I am Trying to detect the close event in browser, which is the best performance for do this ? What's up with Alt+F4, Refresh, user clicks X, etc ? Thanks. -- http://www.alhambra-eidos.es/web2005/index.html www.kiquenet.net
1
2774
by: mmr315 | last post by:
how to destroy session when browser closed with out logout.pls hlp me
1
3715
by: soni2926 | last post by:
hi, i'm working on a site, which has a session created after a user logins, each page checks to make sure the session is there onload otherwise redirects to the login page. now the clients are asking us to make a remember me feature, is there any way to do this with the existing session set up? or do i need to rework it, as remember me from what i was planning was going to drop a cookie, so do i need change all those session checks to...
2
8540
by: tokcy | last post by:
Hi All, I want to kip session alive until i closed the browser. Default session time 30 minutes and if we are using session.gc_maxlifetime then i have to give specific time like 8 hrs or something like this. And i want to keep alive for all time till browser closed. Thanks in Advance.
0
8136
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8086
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8551
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8226
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7017
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5521
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4027
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.