dragunu Posted September 7, 2007 Share Posted September 7, 2007 hello, i would like to run a script to update a database once a page is closed. Now i am using the onUnload() function of js in the body tags of the window. so the code that i am using is similar to this: <script language='javascript'> function send_data() { location.href="updatedb.php"; } </script> <body onunload="send_data()"> </body> now i would like to run updatedb.php without actually loading it on the browser of the client. any suggestion? thanks and regards Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 7, 2007 Share Posted September 7, 2007 this is more an ajax job - as thw browser will close there is no need for the client to view another page so the above would fail to do its job of sending data AND closing the window. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.