// 只需要添加document点击事件,设事件变量为true
var f = false;
$(document).click(function(e){
f = true;
});
window.onbeforeunload = function(){
if(Uploading()){
if( f == false)return "正在上传文件,确定要离开页么?";
f = false;
}
}
本文介绍了一种页面离开前检查是否正在进行文件上传的方法,如果上传未完成,会弹出提示确认用户是否继续离开。
// 只需要添加document点击事件,设事件变量为true
f = false;
}
}
2246

被折叠的 条评论
为什么被折叠?