JQuery 自动完成远程数据
我已经让它工作了,并且我在网上查看并通过文档,由于某种原因它不是很有用!
鉴于此代码按预期工作:
<input type="text" id="color_input" />
<script type="text/javascript">
jQuery('#color_input').autocomplete('autoComplete.aspx');
</script>
我无法弄清楚用户键入的内容如何发送到 autoComplete.aspx 页面?例如,如果我输入“Thoma”,“Thoma”如何发送到处理页面?
它是通过查询字符串发送的吗?或者发个帖子?
I've got it to work, and I have looked online and through the documentation, it's not very useful for some reason!
Given this code that works as expected:
<input type="text" id="color_input" />
<script type="text/javascript">
jQuery('#color_input').autocomplete('autoComplete.aspx');
</script>
What I can't figure out is how what the user has typed is sent to the autoComplete.aspx page? For example if I type in 'Thoma' how is 'Thoma' sent to the processing page?
Does it send it via querystring? Or post it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它使用查询字符串中带有
q=Thoma
的 GET 请求,如 文档。如果您打开 Firebug 或 HTTP headers,您应该能够捕获传出请求并检查它们。
您可以通过设置 选项 将请求更改为使用 POST
It uses a GET request with a
q=Thoma
in the querystring as mentioned in the documentation.If you turn on Firebug or HTTP Headers you should be able to trap the outgoing requests and examine them.
You change the request to use POST by setting the options