Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

But i have an issue though it only returns one record while there are more than one item in the list. Any ideas i did increased the row limit but no luck

$(document).ready(function() {
  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Announcements",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).find("[nodeName=z:row]").each(function() {
        var liHtml = "<li>" + $(this).attr("ows_Title") +  "</li>";
        $("#tasksUL").html(liHtml);
      });
    }
  });
});</script><ul id="tasksUL"/>
share|improve this question
add comment

1 Answer

Try this:

$(document).ready(function() {
  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Announcements",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields><RowLimit>0</RowLimit>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).find("[nodeName=z:row]").each(function() {
        var liHtml = "<li>" + $(this).attr("ows_Title") +  "</li>";
        $("#tasksUL").html(liHtml);
      });
    }
  });
});</script><ul id="tasksUL"/>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.