JQuery 自动完成远程数据

发布于 2024-09-19 08:31:14 字数 362 浏览 3 评论 0原文

我已经让它工作了,并且我在网上查看并通过文档,由于某种原因它不是很有用!

鉴于此代码按预期工作:

<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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

血之狂魔 2024-09-26 08:31:14

它使用查询字符串中带有 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文