一个关于window.onbeforeunload时间,急!急!急!急!
在window.onbeforeunload()事件下通过使用window.event.returnValue = string来提示是否关闭的对话框,但是我现在不想让它出现对话框,而在程序内部判断是否关闭窗口,不知道如何处理????
一般的是:
<script>
function window.onbeforeunload(){
window.event.returnValue = "are you true close window?"
}
</script>
我希望的是:
<script>
function window.onbeforeunload(){
//don't popup dialog!!!!!,how to write the xxx????
if (xxx == true){
//close window
}
else{
//don't close window
}
}
</script>