【发布时间】:2015-03-01 04:18:06
【问题描述】:
当我运行下面的代码时,我收到以下错误: “无法获取未定义或空引用的属性‘结果’”
$(document).ready(function() {
var iceCreamApp = {};
iceCreamApp.Truck = new Array();
//Load data from list into array right away
(function() {
var url = "http://isaac.issharepoint.com/demo/_api/web/lists/GetByTitle('IceCreamTrucks')/items?$select=State";
$.ajax({
url:url,
type:"GET",
dataType:"json",
headers: {"Accept": "application/json; odata=verbose"},
success: function(data) {
success(data);
},
error: function(data) {
//failure(data);
}
})
function success(data)
{
console.log(data);
}
}());
})
【问题讨论】:
-
我得到 [object object]
-
嗨!我收到错误 401 未经授权。我该如何管理?
标签: javascript rest sharepoint-2010