0
Access via JavaScript to Sharepoint list
how is the code look like, when i want retrieve listitems from a list in sharepoint?
1 Answer
0
Hereâs a sample using SPServices JS library.
This used the GetListItems operation and returns each item as an object
$(document).ready(function() {
$().SPServices({
operation: "GetListItems",
async: false,
listName: "Announcements",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
$("#tasksUL").append(liHtml);
});
}
});
});