I am building an app that uses the Geolocation API. I cant seem to get a very simple piece of code to work on Firefox 10. Here is the code:
window.onload = function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
alert('it works');
}, function(error) {
alert('Error occurred. Error code: ' + error.code);
});
}else{
alert('no geolocation support');
}
};
So ,for example, in chrome, after running the page I will be asked if I want to share my location, and after clicking yes it will alert me with "it works". Now in Firefox 10 it will ask me to share my location and after clicking share it does nothing... I've been trying to get the callback to run any type of code but no luck. Is this a bug with Firefox or am I doing something wrong? I have an example of the code here for testing: http://dev-hub.com/geolocation.html.
Edit--- My OS is windows 7 64bit