admin管理员组文章数量:1415491
I am trying to put some custom text on the popup that asks for leave page or stay on the page. I tried this
window.onbeforeunload = function () {
return "This is my custom message";
};
But Mozilla and Chrome still says their own messages while IE shows my message. So what I am trying to do is it should show my custom message with Leave and Stay buttons. And I am sure I have seen in some webiste although I don't remember which website :(
Is it possible?
I am trying to put some custom text on the popup that asks for leave page or stay on the page. I tried this
window.onbeforeunload = function () {
return "This is my custom message";
};
But Mozilla and Chrome still says their own messages while IE shows my message. So what I am trying to do is it should show my custom message with Leave and Stay buttons. And I am sure I have seen in some webiste although I don't remember which website :(
Is it possible?
Share Improve this question asked Jan 2, 2012 at 10:43 Pawan NogariyaPawan Nogariya 9,00813 gold badges59 silver badges131 bronze badges 1- 1 Chrome shows your message first and a general message beneath it. – pimvdb Commented Jan 2, 2012 at 10:46
1 Answer
Reset to default 5Firefox 4 and higher will not show your custom message. See also this answer:
From MDN:
Note that in Firefox 4 and later the returned string is not displayed to the user. See Bug 588292.
This "Bug" is actually a (imho questionable) feature.. so there's no way to display the message in Firefox 4. If you think it should be changed, ment on that bug so the Firefox developers will know that people actually want to be able to show a custom string.
本文标签: javascriptLeave Page Stay On Page With Custom MessageStack Overflow
版权声明:本文标题:javascript - Leave Page Stay On Page With Custom Message - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745231902a2648860.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论