答案:<script type="text/javascript">
var option = {
max: 10,
width: 405,
minChars: 1,
autoFill: false,
scroll: false,
matchContains: true,
delay: 100,
selectFirst: false,
formatItem: function(row, rowNum, rowCount, searchItem) {
return row.Title;
},
formatMatch: function(row, rowNum, rowCount) {
return row.Title;
},
formatResult: function(row, rowNum, rowCount) {
return row.Title;
}
};
function initAutoComplete(data) { $("#search").autocomplete(data, option) };
$("#search").keyup(function() {
if ($("#search").val() == "") {
}
else {
$.getJSON("/ashx/txtQuestion.ashx?time=" + Date(), { Name: $.trim($("#search").val()) }, initAutoComplete);
}
});
</script>
上一个:jquery JS 一个简单问题,只要解释一下就行了.不用写代码
下一个:JS 中<div>的问题??click 事件不执行,忘各位帮我看看问题出在哪里???