【发布时间】:2015-06-28 07:11:10
【问题描述】:
这是我的代码
function getListItem(url, listname, id, complete, failure) {
// Getting our list items
$.ajax({
url: url + "/_api/lists/getbytitle('"+ listname +"')/items",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
// Returning the results
complete(data);
},
error: function (data) {
failure(data);
}
});
};
url 正确出现,同时检查 ajax 调用中的完整 url 参数,当我在新选项卡中打开它时它正在返回数据
但由于此 ajax 调用是在不同域中的共享点应用程序内进行的,因此会引发错误 - No 'Access-Control-Allow-Origin' header is present on the requested resource
我应该在我的站点中进行哪些更改以使该列表可用于跨域调用。
信息:
网站网址是http://www.vignesh.cloudappsportal.com/
应用网址为xxxx.apps.cloudappsportal.net/CloudAppsTrial/Pages/Default.aspx
【问题讨论】:
标签: sharepoint sharepoint-2013 sharepoint-list