开发者

Jquery UI Autocomplete "terms"

开发者 https://www.devze.com 2023-02-27 09:54 出处:网络
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.

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"),
        });
0

精彩评论

暂无评论...
验证码 换一张
取 消