确认浏览器页面上的消息关闭 [英] Confirm message on browser page close

查看:56
本文介绍了确认浏览器页面上的消息关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$(window).bind('beforeunload', function() {return 'Are you shure?';} );

如果用户点击CANCEL按钮页面将重定向到 http://mypage.com

How I must do that if user click CANCEL button page will be redirect to http://mypage.com?

推荐答案

当用户单击对话框中的某个按钮时,您无法更改发生的情况。这是故意的。没有人希望网站将您的导航混乱到那个级别。

You cannot change what happens when the user clicks one of the buttons in the dialog. This is intentional. Nobody wants to have web sites that mess with your navigation to that level.

这篇关于确认浏览器页面上的消息关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆