getting problem in window.onbeforeunload

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sbettadpur
    New Member
    • Aug 2007
    • 121

    getting problem in window.onbeforeunload

    hello

    My requirement goes like this

    If I logged into my application for that time session variable will be created, and login entry will be entering into database table. If i press logout button logout entry will be entered into same table.

    in between if i press window close button the logout entry will not be entered into database table.

    I need once i closed window it should ask "do you want to close" like that and entry should be made in logintimestamp table.

    for this i got code from google called window.onbefore unload

    but using this event handler how to catch "true" and "false" values.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    If the user cancels, you don't need to do anything. However, if (s)he does decide to leave the page, you can open a small window to run your logout code.

    Comment

    Working...