SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : Dynamic HTML :

Previous DiscussionNext Discussion
 how to detect when a user leaves your site
Hi,

I need to take some action when the user leaves my website.
By leave I mean one of the following two cases:
1) Closes the browser
2) Goes to some other site (different domain)

Is there a way to detect this?
I know that the event onbeforeunload and onunload gets fired when the user leaves the page, but these also get fired when the user leaves page A in my site and just goes to page B in my site.

Can anyone think of a way to solve this?
I don't want to alter every link within my site to fire the onclick event and in such event to "remember" in a JavaScript variable this is a navigation within my site.

I am looking for some clean solution if one exists.
For example, is there a way to get the information in the DOM where the user is going to when the onbeforeunload or onunload are fired?

thanks
Jason

Started By jasongr on Aug 4, 2009 at 12:49:10 AM

5 Response(s) | Reply

View All Replies
nirajniyanta on Nov 15, 2010 at 10:01:42 AM

Dear frnds kindly help me my requirent are as follows--
1.i want to excute particular piece of code in webscript on pressing submit button .
now wht happening is tht without presing button sever side code in webscript is get excuted .

2.how to pass the text box value tht is hidden on pressing submit button .

3.using html link or javascrit i want to pass the value of tex boxes to another page.

thanks


View All Replies

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2000 InsideDHTML.com, LLC. All rights reserved.