detect when browser is closed
Posted: Sat Apr 02, 2011 4:37 am
I did this thing:
and what happened was that the function was called all the time.. not only when I closed the browser..
then I ran this:
and the alert showed up only when I closed the browser..
so what's the different?
Code: Select all
window.onbeforeunload = function(){
mysql_query("DELETE * FR.........");
}then I ran this:
Code: Select all
window.onbeforeunload = function(){
alert("window is closed");
}so what's the different?