/ Published in: JavaScript
The following code fetches contents of each Title field from the list called "LandingMiddleLinks"
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getTitles() { // begin work to call across network var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/getByTitle('LandingMiddleLinks')/items"; // execute AJAX request $.ajax({ url: requestUri, type: "GET", headers: { "ACCEPT": "application/json;odata=verbose" }, success: function(data){ $.each(data.d.results, function(index) { console.log($(this).attr('Title')); }); }, error: function(){ alert("Failed to get title"); } }); }