如何使用AJAX调用时,存储到浏览器自动完成/自动补 [英] How to store to browser auto-complete/auto-fill when using AJAX calls

查看:304
本文介绍了如何使用AJAX调用时,存储到浏览器自动完成/自动补的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,浏览器不会存储形式的值,直到表单提交,这意味着如果您使用的是标准的形式,而不是AJAX提交,您的浏览器的自动填充永远不会填充。有没有办法来强制填充您的浏览器自动填充/自动完成,这样我可以有这样的便利性与通过AJAX提交表单?这很烦人去我的AJAX页面,并要在表单字段每次键入相同的事情,因为该浏览器不记得他们。

I've noticed that browsers do not store form values until the form is submitted, which means that if you're using AJAX instead of a standard form submit, your browser's auto-fill is never populated. Is there a way to force populate your browsers auto-fill/auto-complete so that I can have this convenience with forms that are submitted via AJAX? It's annoying to go to my AJAX page and have to type in the same things in the form fields every time because the browser doesn't remember them.

我的问题是pretty的多少等同于<一个href="http://stackoverflow.com/questions/1622628/browser-autocomplete-saved-form-not-work-in-ajax-request">this 之一,但只有一种解决办法在Firefox中提供的接受这个问题的答案。我正在寻找一个解决方案,在所有主要浏览器的工作(至少铬,FF和IE浏览器),如果存在的话。

My question is pretty much identical to the this one, except that only a work around in FireFox is provided as the accepted answer to that question. I'm looking for a solution that works in all major browsers (at least Chrome, FF, and IE), if there is one.

注意:我说的不是AJAX自动完成插件,而这正是谷歌搜索这个问题时,几乎总是弹出。我说的是浏览器的内置自动完成或自动填充,可以帮助您填写表格,通过记住你过去输入的内容。

推荐答案

我也碰到过这一点;似乎没有成为一个很好的解决方案,当然不是一个跨浏览器的,但这里是一个用于IE浏览器我没有看到任何人提及:

I have also come across this; there doesn't seem to be a great solution, certainly not a cross browser one, but here is one for IE I haven't seen anyone mention:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<SCRIPT>
function subForm()
{
window.external.AutoCompleteSaveForm(f1);
f1.submit();
}
</script>
</HEAD>
<BODY>
<FORM id=f1>
User ID : <input type=text name=id></input><br>
Password :<input type=password name=pw></input><br>
E-mail :<input type = text VCARD_NAME = "vCard.Email"> <br>
<input type=button value=submit onclick="subForm()">
</FORM>
</BODY>
</HTML>

来源: http://support.microsoft.com/kb/329156

这篇关于如何使用AJAX调用时,存储到浏览器自动完成/自动补的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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