简体   繁体   中英

Jquery history - Ajax navigation - How to make url request and search request?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM