i'm trying to retrieve data from Sharepoint using SPServices. I created a list called "values" with two field: "Title" (text field) and "values" (numeric field).
I created a js file linked to a Content Editor Web Part and used this script:
<script type="text/javascript" src="/jquery-2.1.4.js"></script>
<script type="text/javascript" src="/jquery.SPServices-2014.02.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$().SPServices({
operation: "GetListItems",
async: false,
listName: "values",
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);
});
}
});
});
</script>
<ul id="tasksUL"/>
When I charge the page I have no result.
I tried to put an alert of XData.responseXML
and it return "Undefined".
How can I resolve it?