// Automatically get the user's location when the page loads window.onload = function() { getLocation(); }; navigator.geolocation.getCurrentPosition(function(position) { // Success logic console.log("Latitude:", position.coords.latitude); console.log("Longitude:", position.coords.longitude); }); function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var lat = position.coords.latitude; var lon = position.coords.longitude; $.ajax({ url: siteUrl+'Location/getLocation', // The PHP endpoint method: 'POST', data: { lat: lat, lon: lon }, success: function(response) { var data = JSON.parse(response); console.log(data); } }); }); } }
A view of the U.S. Capitol building a day before a partial government shutdown is scheduled to take place, on Capitol Hill in Washington, D.C., U.S., September 30, 2025. / REUTERS/Annabelle Gordon
A Democratic bill to fund the U.S. government and end a shutdown was falling short of the votes needed for passage in the Senate on Oct. 3, as voting continued.
ADVERTISEMENT
ADVERTISEMENT
Comments
Start the conversation
Become a member of New India Abroad to start commenting.
Sign Up Now
Already have an account? Login