I’m using JQuery JQueryUI’s AutoComplete code. It goes to my url i provide (to find the answers), but appends ?term=<search query> after the url.
I’m trying to get the following url intead …
/myurl/<term / search query>
eg.
/myurl/abcd
/myurl/hello+world
etc…
is it possible to do this?
Otherwise, it is possible to rename the query parameter term to something else, .. like query to q, etc?
You can use
$.getJSON()yourself in thesourceoption, for example:Something similar happens when you give it a string, it sends the first parameter passed to the method as the object…which has a property
term, by doing it manually you’re just getting more control over your parameters. I’m also usingencodeURIComponent()above to be safe when generating a url directly (e.g. spaces to+, etc.).