我正在使用Firefox 30.0(最新的FF),navigator.geolocation.getCurrentPosition在Chrome中工作,但在这个版本的FF中没有.
这是我的代码
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(GEOprocess, GEOdeclined);
}else{
alert('Your browser sucks. Upgrade it.');
}
function GEOdeclined(error) {
alert('Error: ' +error.message);
}
function GEOprocess(position) {
alert('it works');
}
Run Code Online (Sandbox Code Playgroud)
我收到了这个错误
Error: Unknown error acquiring position
Run Code Online (Sandbox Code Playgroud)
注意:仅当我将FF升级到30.0时,它才会停止工作