title: alternative to onbeforeunload
body: <p>I want to update database when user leave the site. I am using php for my site. I am using javascript function onbeforeunload and call php through ajax to update database. </p>
  
  <p>Now the problem is that the function onbeforeunload is not supported by Opera and Safari, and so the entry should be deleted from database is still over their and affect my database and site.</p>
  
  <p>Any idea or suggestion what i can do?</p>