Firefox 显示 window.onbeforeunload 事件问题
使用 onbeforeunload 函数时,我不想在表单内显示提交按钮和其他一些按钮的警告消息。 我正在检查布尔[T/F]条件来触发它。 它适用于 IE,但似乎没有检查 FireFox 中的条件。 它显示出问题。 有人可以帮忙吗。
谢谢
When using onbeforeunload function, I don't want to show warning message for submit button and some other buttons also inside my form. I am checking boolean[T/F] condition to fire it. It works with IE, but it seems not checking the condition in FireFox. It is showing problem.
Can somebody help.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不是 100% 确定我明白你的意思,但看来你只是想做一些你不应该做的事情。
如果我理解正确,您正在尝试使用 onbeforeunload 事件而不显示警告消息。
想一想。 您可能会发现,那些不把您的最大利益放在心上的人可能会把您留在他的网站上,让您无法离开。 这就是为什么 Firefox 不允许您这样做 - 这是值得高兴的事情!
I am not 100% sure I understand what you mean, but it appears you just trying to do something you shouldn't.
If I understood correctly, you are trying to use the onbeforeunload event without a warning message.
Think about it for a moment. You'll probably see that see that someone that does not have your best interest at heart could keep you at his site and make it impossible for you to leave. That's why firefox doesn't allow you to do it - and that's something to be happy with!
此技术在 IE 和 Firefox 中对我有用。 您并不是想像另一个答案所建议的那样绕过警告消息,您只是不希望按钮上出现警告消息,这非常有意义。
This technique worked for me in IE and Firefox. You aren't trying to bypass the warning message as another answer suggested, you just don't want the warning message on the buttons which makes perfect sense.