我使用这个Bootstrap作为我的GUI.
我看到这个LINK与我的问题有关.但是,当我尝试从@KyleMit
我的控制台中的错误代码.我懂了Uncaught TypeError: $(...).autocomplete is not a function
我目前的Bootstrap
现行守则
$(".autocomplete").autocomplete({
source: "/Controller/Action",
minLength: 1,
select: function (event, ui) {
if (ui.item) {
$(".autocomplete").val(ui.item.value);
}
}
});
检查jquery自动完成的这个基本示例,
JS代码,
$( 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 }); } );
你的HTML,
在头标记中包含以下代码,
你可以在这里找到jsfiddle.