hi guys.. i have a problem with closing up the IE window close button.... i am trying to run some script/command (updating some user status in database) when the user tried to close the windows close[x] button.... i have search for the internet and found out there is "onUnload" method which can be put on the HTML body tag. but i have found that this method has some weaknesses,such as when the page is refresing or when the user press F5, this unload event will also be called....(in other word, i only want the onUnload even is called when the user try to log off or close the windows by clicking the windows button).. so i wonder whether there is any script/method can reliably capture the windows close[x] button to run certain code/commands before the windows is closing.... Another thing is.... i wanna ask whether there is anyway i can actually do : 1. disable the user rightclick function? 2. or disable the refresh function/ user F5 button? if anyone have any clues on how to do any of them pls tell me.... thanks alot~~ anydoubt about my questions pls email me.... my email : susanto_wang@yahoo.com
I think the onUnload event is your only option. I know you can disable the right-click function with some javascript, but you surly can't disable the refresh function.
Add this oncontextmenu="return false;" in body tag to disable the right click. I am facing the same issue with window.unload. Did you guys got the solution?