2 يونيو 2026 16:40 مساء | آخر تحديث: 2 يونيو 16:41 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')); } }); ]]>