John Hexis
unread,Mar 15, 2012, 9:24:03 AM3/15/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium-discuss
I got strange behavior when I tried to test my
"navigator.geolocation.getCurrentPosition" web page. Here is my
testing result and code:
my code:
function detectLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(geocodePosition,
onError, { timeout: 30000 });
navigator.geolocation.watchPosition(watchGeocodePosition);
} else {
onError();
}
}
this function was run when "body" onload event was called. I had tried
to change the timeout to 10000 and 20000, but I still got same result.
I also allowed crome and firefox to get my location.
result:
1. using chrome (v 17.0.963.79 m), result always went to onError
function when navigator.geolocation.getCurrentPosition was called.
2. using Firefox (v 10.0.2), result always went to onError function
when navigator.geolocation.getCurrentPosition was called.
3. using IE (v 9), result was fantastic, I got my current location.
can anyone help me in this strange situation? I really didn't have any
idea to solve this problem and I was in hurry on my project deadline.
Thank you.