Javascript 未捕获类型错误:无法读取属性';标题';查询SharePoint列表时的未定义字段
我正在尝试将结果从SharePoint列表返回到HTML页面。我正在使用下面成功使用的代码,但在本例中,它不会返回结果 使用控制台,我得到了“uncaughttypeerror”,这篇文章正促使我找到一个解决方案:但我不知道我应该把Ajax函数放在哪里 这是JavaScript,如果有人能提出建议的话Javascript 未捕获类型错误:无法读取属性';标题';查询SharePoint列表时的未定义字段,javascript,json,ajax,sharepoint-2010,Javascript,Json,Ajax,Sharepoint 2010,我正在尝试将结果从SharePoint列表返回到HTML页面。我正在使用下面成功使用的代码,但在本例中,它不会返回结果 使用控制台,我得到了“uncaughttypeerror”,这篇文章正促使我找到一个解决方案:但我不知道我应该把Ajax函数放在哪里 这是JavaScript,如果有人能提出建议的话 var call = $.ajax({ url: query, type: "GET", dataType: "json", he
var call = $.ajax({
url: query,
type: "GET",
dataType: "json",
headers: {
Accept: "application/json;odata=verbose"
}
});
call.done(function (data,textStatus, jqXHR){
$.each(data.d.results, function(index, item) {
var KnownTitle = item.Title;
JSON
共享您的JSON结构我在哪里可以找到它?添加console.log(JSON.stringify(data));在完成的函数内粘贴“console.log(JSON.stringify(data));”进入call.done(function(data,textStatus,jqXHR)行?在$each之前是。然后共享控制台的输出
{
"d": {
"results": [{
"__metadata": {
"uri": "collaboration-dev.nogine.com/sites/it/SstemInventory/_vti_in/…\"1\"",
"type": "Microsoft.SharePointDataService.KnownisuesItem"
},
"Title": "etwork Issue",
"IssueID": 1
}, {
"__metadata": {
"uri": "collaboration-dev.norgine.com/sites/it/SystemInventory/_vti_bin/…\"1\"",
"type": "Microsoft.SharePont.DataService.KnowissuesItem"
},
"Title": "Door problem",
"IssueID": 2
}]
}
}