onunload时间会被google工具条拦掉

onunload时间会被google工具条拦掉

<script>
        function window.onbeforeunload()  {
                if (event.clientX > document.body.clientHeight || event.clientY < 0 || event.altKey)  {
                      alert("That's good.");
                }
        }
</script>
 

<--------屏蔽F5、Alt+F4的错-------->

<script>
        function window.onbeforeunload()  {


                if((event.keyCode != 0) && (event.clientX > document.body.clientHeight || event.clientY < 0) || event.altKey)  {

                      alert("That's good.");
                }
        }
</script>

你可能感兴趣的:(onunload时间会被google工具条拦掉)