I want to execute script function for the following conditions ,
1. when user press Alt+F4 key
2. from taskbar->rightclick-> close the browser option.
But My html dosn't contains <BODY> tag.
So, I implemented window closing for X button(Its fine). The code shown in bellow.
It helps you to solve my issue
Expand|Select|Wrap|Line Numbers
- <script>
- window.onunload=function1;
- function1= function() {
- if (event.clientY < 0){
- //alert("call another function");
- }
- // Need code for Alt+F4 same as above
- // Need code for mouse right click event
- }
- </script>
Let me know , if u have any issues.([edit])
Regards,
Srinivas