1$(document).ready(function () { 2 GetCareerSection(); 3 GetEventSnippet(); 4}); 5 6 7 var subsite = _spPageContextInfo.webAbsoluteUrl; 8 9 10 function GetCareerSection() { 11 var aboutGrants = ""; 12 var listUrl = "/_api/web/lists/getByTitle('Events')/items?$select=*&$filter=Section eq 'Career Development'"; 13 $("#careerDevelopment").html(""); 14 $.ajax({ 15 url: subsite + listUrl, 16 type: "GET", 17 headers: { 18 Accept: "application/json;odata=verbose" 19 }, 20 success: function (data) { 21 jQuery.each(data.d.results, function (index, item) { 22 var title = item.Title != "" ? item.Title : ""; 23 var link = ""; 24 if(item.Link != null){ 25 link = item.Link.Url; 26 }else{ 27 link = ''; 28 } 29 var content = item.Content; 30 aboutGrants += '<div class="container-fluid event-bg-image">'; 31 aboutGrants += '<div class="container h-100">'; 32 aboutGrants += '<div class="bg-internal-content">'; 33 aboutGrants += '<div class="bg-text banner-mobile-spacing">'; 34 aboutGrants += '<h2 class="services-heading press-banner-heading">'+title+'</h2>'; 35 aboutGrants += '<a href="'+link+'" class="btn btn-primary">See Grants & Funds</a>'; 36 aboutGrants += '</div></div></div></div>'; 37 $("#careerDevelopment").append(aboutGrants); 38 39 }) 40 41 }, eror: function (data) { 42 console.log("An error occurred. Please try again."); 43 } 44 }) 45 } 46function GetEventSnippet() { 47 var aboutAchievements = ""; 48 var listUrl = "/_api/web/lists/getByTitle('Events')/items?$select=*&$filter=Section eq 'Snippet for Events'"; 49 $("#EventSnippet").html(""); 50 $.ajax({
51 url: subsite + listUrl, 52 type: "GET", 53 headers: { 54 Accept: "application/json;odata=verbose" 55 }, 56 success: function (data) { 57 jQuery.each(data.d.results, function (index, item) { 58 var title = item.Title != "" ? item.Title : ""; 59 var link = ""; 60 if(item.Link != null){ 61 link = item.Link.Url; 62 }else{ 63 link = ""; 64 } 65 var video = ""; 66 if(item.Video != null){ 67 video = item.Video.Url; 68 }else{ 69 video = ""; 70 } 71 var content = item.Content != "" ? item.Content : ""; 72 var VideoId = ""; 73 var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/; 74 var match = video.match(regExp); 75 if (match && match[2].length == 11) { 76 VideoId = match[2]; 77 VideoId = "https://www.youtube.com/embed/" + VideoId; 78 } else { 79 //error 80 } 81 aboutAchievements += '<div class="col-md-5 d-flex flex-column justify-content-center align-items-center align-items-md-start">'; 82 aboutAchievements += '<h3 class="text-uppercase">'+title+'</h3>'; 83 aboutAchievements += '<p>'+content+'</p>'; 84 aboutAchievements += '</div>'; 85 aboutAchievements += '<div class="col-md-7">'; 86 aboutAchievements += '<iframe src="'+VideoId+'"></iframe>'; 87 aboutAchievements += '</div>'; 88 89 $("#EventSnippet").append(aboutAchievements); 90 91 }) 92 93 }, eror: function (data) { 94 console.log("An error occurred. Please try again."); 95 } 96 }) 97 } 98
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.