第一个实现工作正常。第二个提供了一个下拉列表,但在您键入时它不会被过滤。
$( "#tags" ).autocomplete({
source: availableTags
});
$( "#tags1" ).autocomplete({
source: "http://nwx1/mysql/useractivitytxn/f_UsersList.php"
});
...
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
<label for="tags1">Tags1: </label>
<input id="tags1">
<label for="tags2">Tags2: </label>
<input id="tags2">
</div>
var availableTags = [“ActionScript”、“AppleScript”、“Asp”、“BASIC”、“C”、“C++”、“Clojure”、“COBOL”、“ColdFusion”、“Erlang”、“Fortran”、“Groovy” ”、“Haskell”、“Java”、“JavaScript”、“Lisp”、“Perl”、“PHP”、“Python”、“Ruby”、“Scala”、“Scheme”];
Web 服务的返回值:["ActionScript","AppleScript","Asp","BASIC","C","C++","Clojure","COBOL","ColdFusion","Erlang"," Fortran","Groovy","Haskell","Java","JavaScript","Lisp","Perl","PHP","Python","Ruby","Scala","Scheme"]
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.22/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/external/jquery.bgiframe-2.1.2.js" type="text/javascript"></script>