1// ФÑнкÑÐ¸Ñ Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка аномалий 2function findAnomalies() { 3 const anomalies = []; 4 5 // ÐоиÑк изобÑажений без alt аÑÑибÑÑа 6 const images = document.querySelectorAll('img'); 7 images.forEach(img => { 8 if (!img.hasAttribute('alt')) { 9 anomalies.push({ type: 'Image without alt', element: img }); 10 } 11 }); 12 13 // ÐоиÑк ÑлеменÑов Ñ ÑлиÑком болÑÑим колиÑеÑÑвом ÑекÑÑа 14 const textElements = document.querySelectorAll('p, div'); 15 textElements.forEach(el => { 16 if (el.innerText.length > 500) { // ÐÑÐ¸Ð¼ÐµÑ Ð¿Ð¾Ñога 17 anomalies.push({ type: 'Long text element', element: el }); 18 } 19 }); 20 21 // ÐоиÑк ÑлеменÑов без заголовков 22 const sections = document.querySelectorAll('section'); 23 sections.forEach(section => { 24 if (!section.querySelector('h1, h2, h3')) { 25 anomalies.push({ type: 'Section without headings', element: section }); 26 } 27 }); 28 29 // ÐÑвод найденнÑÑ Ð°Ð½Ð¾Ð¼Ð°Ð»Ð¸Ð¹ в конÑÐ¾Ð»Ñ 30 displayAnomalies(anomalies); 31} 32 33// ФÑнкÑÐ¸Ñ Ð´Ð»Ñ Ð²Ñвода аномалий в конÑÐ¾Ð»Ñ 34function displayAnomalies(anomalies) { 35 console.log('Anomalies Found:'); 36 anomalies.forEach(anomaly => { 37 console.log(`${anomaly.type}:`, anomaly.element.outerHTML); 38 }); 39} 40 41// ÐвÑомаÑиÑеÑкий запÑÑк ÑкÑипÑа пÑи загÑÑзке ÑÑÑаниÑÑ 42window.onload = findAnomalies;
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.