1
window.onbeforeunload = function (event) {
//action
};
我试过这个链接,但它也被刷新页面刷新。 How to capture the browser window close event?检测浏览器关闭事件,但不在页面刷新jquery
window.onbeforeunload = function (event) {
//action
};
我试过这个链接,但它也被刷新页面刷新。 How to capture the browser window close event?检测浏览器关闭事件,但不在页面刷新jquery
这个手动或务实是手动刷新手柄..
$('body').on('keydown', function(e) {
if (e.keyCode == 116){
//code here. to prevent calling window.onbeforeunload
}
});
页面刷新? – deepakb
这是为什么标记[打字稿]? – Abhitalks
手动刷新 –