1
由于镖里程碑8,那是不可能的他(她)通过以下方法导航离开页面之前,以提醒用户:警报之前卸载在DART M8
window.onBeforeUnload.listen((BeforeUnloadEvent event) {
event.returnValue = 'Are you sure you want to leave?';
});
自Event.returnValue字段已被删除。 你如何用新的API实现这种效果?
这是它是如何使用jQuery做:
$(window).on('beforeunload', function(){
return 'Are you sure you want to leave?';
});