PDA

View Full Version : browser events



rojar
5 Jun 2007, 11:55 PM
Hi,

I have created a logon page where user enters username and password and logs on to website.

1) What I need is if user clicks browser's corss button after logging an alert should appear conforming from user that if he wants to close window. If user clicks yes then user should be logged off.

2) Similar behaviour is needed when user logs on and then click browser's back button .


How can I achieve this. I have been looking for javascript code but to no benefit.


Waiting for your response.


Thanks.

huling
3 Mar 2008, 6:49 PM
window.onbeforeunload = your.fn
window.onunload = your.fn