Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy how to execute a function when web page window is being closed

    Hi guys i need help ,

    I want to execute a function when the web page brower window is closed.i want to run a query on database when the user closes the browser window.i think i can do this by running a query in the javascript function.

    If any of you has a different approach then pls let me know. I'm developing jsp application. i want to run a query on MySql database when the user closes the window.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Learn to read the rules please. This is the post a javascript forum, not the how do you do this in javascript forum. Either way look into onbeforeunload along with some ajax that will post back to your jsp code. Good luck.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •