我想从通过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