View Single Post
Old Apr 9th, 2008, 6:03 PM   #1
sudha
Newbie
 
Join Date: Apr 2008
Posts: 1
Rep Power: 0 sudha is on a distinguished road
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

Last edited by Ancient Dragon; Apr 10th, 2008 at 8:28 PM. Reason: add code tags
sudha is offline   Reply With Quote