Daily duah list







<script>
        async function fetchPrayerTimes() {
            const prayerTimesUrl = 'https://raw.githubusercontent.com/mdmahabubhossain/FIA/refs/heads/main/prayer_times_2025.json';
            const prayerTimesContainer = document.getElementById('prayer-times');
            const errorMessageContainer = document.getElementById('error-message');

            try {
                // Fetch data from the URL
                const response = await fetch(prayerTimesUrl);
                if (!response.ok) throw new Error('Failed to fetch prayer times data.');

                const prayerTimes = await response.json();

                // Get today's date in YYYY-MM-DD format
                const today = new Date().toISOString().split('T')[0];
                console.log('Today\'s Date:', today); // Debugging log

                // Find today's prayer times
                const todayPrayerTimes = prayerTimes.find(entry => entry.Date === today);

                if (todayPrayerTimes) {
                    // Clear previous content
                    prayerTimesContainer.innerHTML = `
                        <h3>Prayer Times for Today (${today})</h3>
                        <ul>
                            <li><strong>Fajr:</strong> ${todayPrayerTimes.Fajr}</li>
                            <li><strong>Dhuhur:</strong> ${todayPrayerTimes.Dhuhur}</li>
                            <li><strong>Asr:</strong> ${todayPrayerTimes.Asr}</li>
                            <li><strong>Maghrib:</strong> ${todayPrayerTimes.Maghrib}</li>
                            <li><strong>Ishaa:</strong> ${todayPrayerTimes.Ishaa}</li>
                        </ul>
                    `;
                } else {
                    prayerTimesContainer.innerHTML = `<p>No prayer times available for today (${today}).</p>`;
                }
            } catch (error) {
                console.error('Error loading prayer times:', error);
                prayerTimesContainer.innerHTML = '';
                errorMessageContainer.textContent = 'Error loading prayer times. Please try again later.';
            }
        }

        // Fetch prayer times on page load
        fetchPrayerTimes();
    </script>

Comments

Popular posts from this blog

HP Pavilion Laptop 15-eg0xxx Disassembly to access RAM and SSD. 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz

What I found before buying a used laptop in respect of Bangladesh. intel core i3 11th vs i7 6th vs i5 7th and i5 8th generation.

Blogger Posts what you need to do for popularizing it, ways to Add Keywords and Meta Tags to your post