标签: javascript jquery twitter-bootstrap
$(window).on('beforeunload', function(e) { $('#myModal').modal(); // open bootstrap modal, etc, not important return false; });
这是我的代码。如何隐藏默认确认窗口和绑定按钮"离开页面"和"留在页面"在我的boostrap模式中采取适当的行动?
答案 0 :(得分:0)
简单的答案是“你不能”。
beforeunload
The only thing you can do是设置returnValue让浏览器UI询问用户是否真的要离开。
returnValue