I am using the jquery Ui autocomplete library, and everything works great but I am having one problem with the "terms=" that is put on the end of the url.
What I need is the source to looks at "www.mysite.com/searchTerms=[searchvar]" where right now it automatically puts "terms=[searchvar]" at the end of any url i put in.
$("#tags").autocomplete({
source: 'http://www.mysite.com/search/autoComplete.mi?searchTerm=',
});
wi开发者_StackOverflowth this, if I type 'horse', then it looks for the url "http://www.mysite.com/search/autoComplete.mi?searchTerm=&term=horse' when i need it to look for "http://www.mysite.com/search/autoComplete.mi?searchTerm=horse"
the html
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags" />
</div>
I looked through the documentation and couldn't find anything
You can do it with an attribute in the tags object:
$("#tags").autocomplete({
source : 'http://www.mysite.com/search/autoComplete.mi?searchTerm='+
$(this).attr("searchvalue"),
});
精彩评论