如何告诉浏览器不要保存错误的密码?
通常在网站上,如果我错误地输入了错误的密码,我会返回一个指示错误凭据的页面,但 Chrome(或其他)会提示我“您想记住此密码吗?”
有没有什么方法可以提示浏览器现在不是询问的时间,这样它只在用户输入正确的密码时进行提示?
Often on a website, if I enter the wrong password by mistake, I get a page back that indicates the wrong credentials, but Chrome (Or whatever) prompts me with "Would you like to remember this password?"
Is there any way to hint to the browser that now is not the time to ask, so that it only prompts if the user enters a correct password?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 JQuery & Ajax 将登录表单发布到服务器并接收响应,而无需重新加载页面,从而完全避免了此问题。
编辑
类似于此的内容(未经测试):
You could use JQuery & Ajax to post the login form to the server and recieve a response back without ever reloading the page, thus avoiding this problem altogether.
EDIT
Something along the lines of this (untested):
不会。浏览器会在提交表单时显示消息。它不会等待服务器的响应,因此无法判断密码是否正确。
稍微相关:
No. The browser displays the message at the moment the form is submitted. It doesn't wait for the server's response, so there's no way to tell wether or not the password is correct.
Slightly related: