我的JSP文件:
<div class="col-xs-8 col-sm-7 col-md-4 col-lg-4">
<div class="form-group">
<label for="autoComplt" class="col-xs-5 col-sm-5 col-md-4 col-lg-5 control-label">Auto Complete : </label>
<div class="col-xs-7 col-sm-7 col-md-8 col-lg-7">
<input id="autoComplt" type ="text" name="autoComplt" class="form-control"/>
</div>
</div>
</div>
我的JS文件:
var availableTags = [];
$.ajax({
url: contextPath + "/branchMst/findDistinctBranch.html",
method: 'GET',
dataType: 'json',
success: function(data) {
$.each(data, function() {
availableTags.push(this.toString());
});
return availableTags;
}
});
$("#autoComplt").autocomplete({
source: availableTags
});
object1 对象2