尝试使用下面的例子不要忘记,包括Jquery最新的文件;)恩乔伊弟兄
<script>
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$("#tags").autocomplete({
source: availableTags
});
});
</script>
<div class="demo">
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</div>
</div><!-- End demo -->
<div style="display: none;" class="demo-description">
<p>The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are tags for programming languages, give "ja" (for Java or JavaScript) a try.</p>
<p>The datasource is a simple JavaScript array, provided to the widget using the source-option.</p>
</div><!-- End demo-description -->
来源
2012-07-20 12:54:52
GOK
我无法跟随在这个例子中,我的“#tags”是什么以及什么是源 – user1491704 2012-07-19 19:06:23
在页面右侧单击“远程JSONP数据源”,然后在“查看源代码”中单击中间,然后您将看到整个示例。 – PoulsQ 2012-07-19 19:08:26
找不到这样的东西:( – user1491704 2012-07-19 19:14:18