我想從通過AJAX調用的Web服務文件中獲取用戶數據列表。這裏是我的代碼:我的jquery顯示這個錯誤?
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript">
var param;
var resultarr;
$(document).ready(function() {
param = document.getElementById('MainCT_dtvJobVac_PIC').value;
// Load countries then initialize plugin:
$.ajax({
type: 'POST',
contentType: 'application/json;',
data: '{keyword:' + JSON.stringify(param) + '}',
dataType: 'json',
url: 'SvcADUser.asmx/GetADUserList',
success: function (result) {
//alert(result.d)
resultarr = result.d;
}
})
// Initialize autocomplete with local lookup:
$('#MainCT_dtvJobVac_PIC').autocomplete({
source: resultarr
});
});
</script>
resultarr
將輸出數組與此值:
[ "Administrator", "Guest", "krbtgt", "phendy" , "Genin" , "Hendra" , "andri" ]
它拋出這個:
TypeError: this.source is not a function [Break On This Error] this.source({ term: value }, this._response());
什麼我需要在這裏解決?我在這掙了2天,有些幫助將不勝感激。
這是一個不好的標題示例。請閱讀http://meta.stackexchange.com/questions/10647/how-do-i-write-a-good-title – 2013-05-14 12:28:45
「它扔我這個錯誤:'this.source({term:value},this。 _response());'「嗯,這不是一個錯誤。 – tnw 2013-05-14 12:30:10
TypeError:this.source不是函數 [Break On This Error] \t this.source({term:value},this._response()); – NomNomNom 2013-05-14 12:31:16