YUI:自定义取消窗口关闭事件时浏览器显示的消息
我有一个 YUI 应用程序。 在某些情况下,我想在用户关闭窗口之前提醒他。 因此,我捕获窗口关闭事件并执行
onWindowClose: function(e) {
if (...)
{
YAHOO.util.Event.preventDefault(e);
}
}
浏览器显示一条标准消息:“您确定要离开此页面吗?按确定继续,取消以留在当前页面”。
如何自定义浏览器显示的消息?
I have a YUI application.
Under certain circumstances I want to alert the user before he closes the window.
Therefore I capture the window close event and do
onWindowClose: function(e) {
if (...)
{
YAHOO.util.Event.preventDefault(e);
}
}
The browser shows a standrd message: "Are you sure you want to navigate away from this page? Press OK to continue, cancel to stay in the current page".
How can I customize the message the browser shows?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查 onbeforeunload 事件和我的答案
显示消息框当用户关闭 IE
和
ASP.NET:更改时发出警告数据关闭窗口
它可能对你有用。
Check for onbeforeunload event and my answer in
show a message box when user close IE
and
ASP.NET: Warning on changed data closing windows
It may work for you.