<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>