Use your console log to see what error you’re getting.
I get this on JSFiddle, I’m not sure if it’s the same thing you’re getting:
"error": {
"type": "querynotfound"
,"description": "No cities match your search query"
}
The reason is because you’re calling the success function, where the Geo is being set, before you call the ajax. You can fix that by wrapping the AJAX in a function and calling that after navigator.geolocation.getCurrent()
. Then when you fix that, you’ll get the error “Please use POST”, so add the setting method:'POST'
to your AJAX settings. Then I think it works.