1 2let debounceCall = null, 3 activeApiRequestCall = null 4 5function sendInternsData(topic) { 6 // Abort the previous API request if request exists and is NOT complete (readyState 4) 7 if (activeApiRequestCall && activeApiRequestCall.readyState !== 4) { 8 activeApiRequestCall.abort(); 9 } 10 11 let counselWrapper = $(".students-list-filter-data"); 12 13 activeApiRequestCall = $.ajax({ 14 url: "/api/sitecore/Intern/GetInterns", 15 type: 'POST', 16 data: { 17 topic: topic 18 }, 19 success: function (response) { 20 counselWrapper.empty(); 21 22 var res = $.trim(response); 23 24 if (res === "") { 25 counselWrapper.html('<h2 class="mt-4 mt-md-5 text-center">DATA NOT FOUND</h2>'); 26 } 27 else { 28 counselWrapper.append(response); 29 } 30 }, 31 error: function (xhr, textStatus, errorThrown) { 32 if (textStatus === 'abort') { 33 console.log('Outdated API request successfully canceled.'); 34 } else { 35 console.error('API Error:', errorThrown); 36 } 37 } 38 }); 39} 40 41$(document).ready(function () { 42 sendInternsData("All"); 43}); 44 45$(document).on('click', '.btn-list__toggle button', function () { 46 const $getText = $(this).text().replace(/\s+/g, ' ').trim(); 47 48 clearTimeout(debounceCall); 49 50 debounceCall = setTimeout(function () { 51 sendInternsData($getText); 52 }, 100); 53});
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.