Jquery历史 - Ajax导航 - 如何发出url请求和搜索请求?

发布于 2024-08-11 10:39:32 字数 245 浏览 2 评论 0原文

我正在使用 Jquery 历史记录 示例:mikage.to/jquery/jquery_history.html

我真的不知道如何使用搜索框表单进行搜索查询以及如何创建搜索链接,例如:

mysearch.php?search=search+term&submit=1

正常的链接通常如下: load 3

可能是在主页的函数中添加代码,但我不熟悉 javascript

谢谢你的帮助

I'm using the Jquery history
exemple: mikage.to/jquery/jquery_history.html

I don't really know how to make a search query using a search box form and how to create a search link like:

mysearch.php?search=search+term&submit=1

Normal link are usually as follow:
load 3

It's probably adding code to the function in the main page but i'm not to familliar with javascript

Thank you for your help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

月寒剑心 2024-08-18 10:39:32

如果您已经有一个表单,您可以执行以下操作:

var dataString=$("#searchForm").serialize();
$.ajax({
  type: "GET",
  url: getString,
  data: dataString,
blablahblah

虽然您的问题有点模糊,但序列化将为您创建参数字符串。

If you have a form already, you can do something like:

var dataString=$("#searchForm").serialize();
$.ajax({
  type: "GET",
  url: getString,
  data: dataString,
blablahblah

Your question is a bit vague though, but serialize will create the parameters string for you.

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