Get List Items Using Rest API Sharepoint 2013
function getItems(url, callback) {
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + url,
type: "GET",
headers: {
"accept": "application/json;odata=verbose",
},
success: function(data) {
callback(data.d.results);
},
error: function(error) {
alert(JSON.stringify(error));
}
});
}
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + url,
type: "GET",
headers: {
"accept": "application/json;odata=verbose",
},
success: function(data) {
callback(data.d.results);
},
error: function(error) {
alert(JSON.stringify(error));
}
});
}
Comments