Read list items using REST api with JQuery

$.ajax({
    async: true,
    crossDomain: true,
    url: "http://----------------/sites/-----/_api/Web/Lists/GetByTitle('Menu')/items",
    method: "GET",
    headers: {
        "accept": "application/json;odata=verbose",
        "cache-control": "no-cache",
        "postman-token": "452d273c-96f4-d2a1-bd34-463ab627e4ab"
    },
    success: function (data) {
        $.each(data.d.results, function (index, item) {
           var id = item.ID;
           var title = item.Title;
           //var url = item.url;
  alert(item.DeptLink);
        });
    },
    complete: function (data) {
      alert('complete');
    }
});

Comments

Popular posts from this blog

Email Validation for SharePoint list column

Create a SharePoint group and add users using JSOm

SP, UDF and VIEW