Tuesday, February 23, 2016

SharePoint List items stored in array JavaScript

var titleArray[]="";
$(document).ready(function() {
  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Employee",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).SPFilterNode("z:row").each(function() {
        var liHtml =   $(this).attr("ows_Title") ;
       titleArray.push(liHtml);
      });
    }
  });
});


No comments:

Post a Comment