3 يونيو 2026 13:01 مساء | آخر تحديث: 3 يونيو 13:05 2026
`; } }) .catch(error => { console.error('Error fetching articles:', error); responseContainer.innerHTML = `خطأ أثناء تحميل المقالات
`; }); } filters.forEach(button => { button.addEventListener('click', () => { filters.forEach(b => b.classList.remove('active')); button.classList.add('active'); const days = button.getAttribute('data-days'); const sections = button.getAttribute('data-section'); fetchArticles(days, sections); }); }); // Initial load with days=1 using the first button's section const firstButton = filters[0]; if (firstButton) { firstButton.classList.add('active'); fetchArticles(1, firstButton.getAttribute('data-section')); } }); ]]>