相关疑难解决方法(0)

navigator.geolocation.getCurrentPosition在Firefox 30.0中不起作用

我正在使用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时,它才会停止工作

firefox navigator

8
推荐指数
2
解决办法
5565
查看次数

标签 统计

firefox ×1

navigator ×1