1$(document).ready(function () { 2 getNews(); 3}); 4 5function getNews(){ 6 7 var dc = this; 8 var requestUri = window.location.protocol + "//" + window.location.host + _spPageContextInfo.siteServerRelativeUrl + "_api/web/lists/getbytitle('News')/items?$orderby=Modified asc"; 9 dc.successCallback = function (responseData, ResultsItems, queryTxt) 10 { 11 pCount = responseData.d.results.length; 12 var news = ""; 13 responseData.d.results.forEach(Display); 14 function Display(element, index, array) 15 { 16 news += '<div class="col-md-3 col-sm-6 col-xs-6"><div class="thumbnail"><div class="caption">'; 17 news += '<h3>' + element.Title + '</h3>'; 18 news += '<p><a target="_blank" href="' + element.URL.Url + '">' + element.Description.substr(0, 70) + '...</a></p></div></div></div>'; 19 } 20 $(".news-box").html(news); 21 } 22 23 dc.failureCallback = function (error) { 24 console.log("error"); 25 } 26 27 execAjax( 28 requestUri, 29 dc.successCallback, 30 dc.failureCallback, 31 false 32 ) 33}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.