if (navigator.geolocation){
navigator.geolocation.getCurrentPosition(showPosition);
}
Basically this gets the long/latitude using W3C geolocation API and uses google map reverse geocoding to get an address. But the address doesn't send through the ajax, it just fails completely. There is nothing wrong with the SQL query I got running on a separate page.
If I take
> + "&place=" + placename
out, then it works fine (except doesn't log the place name with the rest of the info.)
Anonymous D joined in and replied with this 15 years ago, 5 days later, 5 days after the original post[^][v]#244,444
bump
placename is defined inside the geocoder.getLocations function scope, which is a callback. That means, it gets called when the ajax call completes. Move your $.ajax call right after var placename = address.address; for fun & profit.