我是一個jQuery新手,並嘗試與jQuery typewatch一起實現自動完成功能。也就是說,要在一定的時間週期(例如750毫秒)之後從Web服務獲取數據,而不是在minLength之後。jquery自動完成與類型手錶
<script type="text/javascript">
$(document).ready(function() {
$('.searchinput').autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/Services/SampleWebService.asmx/GetProduct",
data: '{"searchString":"' + request.term + '"}',
dataType: "json",
async: true,
success: function (data) {
response(data);
}
});
},
});
$('.searchinput').typewatch({
callback: $.autocomplete,
wait: 750,
highlight: false
});
});
我自動完成事情的作品精美絕倫,但不知何故,我不能夠包括typewatch的事情吧。我確信有一個我不知道的嚴重編碼故障。
感謝
你只是真棒搜索!謝謝。 –