Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   JavaScript and Client-Side Browser Scripting (http://www.programmingforums.org/forum23.html)
-   -   Window close event (http://www.programmingforums.org/showthread.php?t=15581)

sudha Apr 9th, 2008 6:03 PM

Window close event
 
Hi Guys,

I am using the following javascript code in my dbconnect.asp file to catch the window close event to update the database in logout.asp.
:

window.onbeforeunload =
 function(){
  if((window.event.clientX<0) || (window.event.clientY<0)){
      changeStatus();
  }
 }

function changeStatus() {
 
 window.location = "logout.asp"
 
 }

this code works fine but when I am navigating the site and click the browser back button the system is throwing me out. how can I prevent this

Can anybody help me with this?

Thanks in advance

sudha


All times are GMT -5. The time now is 9:12 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC