1/*document.addEventListener('DOMContentLoaded', function() { 2 AjaxLoadList(); 3});*/ 4 5function AjaxLoadList(js_class_list = 'js-ajax-list') { 6 var listElement = document.querySelector('.' + js_class_list); 7 8 document.addEventListener('click', function(e) { 9 let target = e.target.closest('.' + js_class_list + ' .js-ajax-button'); 10 if (!target) return; 11 e.preventDefault(); 12 13 // ÐобавлÑем клаÑÑ Ð´Ð»Ñ Ð¿ÑелоадеÑа 14 listElement.classList.add('ajax-loading'); 15 target.classList.add('ajax-load'); 16 17 fetch(target.dataset.url, { 18 method: 'GET', 19 headers: { 20 'X-Requested-With': 'XMLHttpRequest' 21 } 22 }) 23 .then(function(response) { 24 return response.text(); 25 }) 26 .then(function(data) { 27 listElement.innerHTML = data; 28 }) 29 .catch(function(err) { 30 console.log(err); 31 }) 32 .finally(function() { 33 listElement.classList.remove('ajax-loading'); 34 target.classList.remove('ajax-load'); 35 }); 36 }); 37}
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.