4.9 stars on
(309,614 reviews)
Taj Mahal

Taj Mahal in India

Today, Taj Mahal is the most iconic monument in India and one of the most visited attractions of the country. There are several myths and legends behind this beautiful work of art, which are only rumors. Perhaps the truest of these stories is the dedication and love of an emperor to his wife.

Chat Icon

Login

' ); // Store reference to the popup window.googleSignInPopup = tempPopup; // Fetch the Google auth URL via AJAX var xhr = new XMLHttpRequest(); xhr.open('GET', authUrl, true); xhr.onreadystatechange = function() { if (xhr.readyState === 4) { if (xhr.status === 200) { try { console.log('AJAX response:', xhr.responseText); var response = JSON.parse(xhr.responseText); if (response.success && response.data && response.data.redirect_url) { // Redirect the popup to the Google auth URL tempPopup.location.href = response.data.redirect_url; // Focus the popup tempPopup.focus(); // Start polling for navigation events var popupCheckInterval = setInterval(function() { if (!tempPopup || tempPopup.closed) { clearInterval(popupCheckInterval); // If the popup closed and we haven't received a message, // but we've set the googleSignInSuccess flag, refresh the page if (window.googleSignInSuccess && !window.googleSignInMessageReceived) { console.log('Popup closed with successful login, refreshing page'); window.location.reload(); } return; } try { // Check if popup URL contains accounts.youtube.com/accounts/SetSID // or if it contains /account - both indicate successful auth var popupUrl = tempPopup.location.href; if (popupUrl.includes('accounts.youtube.com/accounts/SetSID') || popupUrl.includes('/account')) { console.log('Detected successful auth via URL check'); // This indicates successful authentication window.googleSignInSuccess = true; // Force close the popup tempPopup.close(); // Refresh the page setTimeout(function() { window.location.reload(); }, 500); // Clear the interval clearInterval(popupCheckInterval); } } catch (e) { // This will throw a security error when the popup navigates to a different domain // Just ignore it - it's expected behavior } }, 500); // Set a timeout to clear the interval after 2 minutes setTimeout(function() { if (popupCheckInterval) { clearInterval(popupCheckInterval); } }, 120000); } else { console.error('Invalid AJAX response:', response); tempPopup.close(); alert('Error: Could not connect to Google. Please try again.'); } } catch (e) { console.error('Error parsing AJAX response:', e, xhr.responseText); tempPopup.close(); alert('Error: Could not initialize Google Sign-In. Please try again later.'); } } else { console.error('AJAX request failed:', xhr.status, xhr.statusText); tempPopup.close(); alert('Error: Could not connect to Google. Please try again.'); } } }; xhr.onerror = function() { console.error('AJAX request error'); tempPopup.close(); alert('Error: Could not connect to Google. Please check your internet connection and try again.'); }; xhr.send(); } // Listen for messages from the popup window.addEventListener('message', function(event) { if (event.data && event.data.type === 'GOOGLE_SIGNIN_RESULT') { console.log('Received message from popup:', event.data); window.googleSignInMessageReceived = true; if (event.data.success) { window.googleSignInSuccess = true; // Refresh the page setTimeout(function() { window.location.reload(); }, 500); } } }, false);