navigator.geolocation.getCurrentPosition在Firefox 30.0中不起作用 [英] navigator.geolocation.getCurrentPosition do not work in Firefox 30.0

查看:246
本文介绍了navigator.geolocation.getCurrentPosition在Firefox 30.0中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Firefox 30.0(最新的FF), navigator.geolocation.getCurrentPosition 在Chrome中工作,但不在FF的这个版本中。 b

这里是我的代码

  if(navigator.geolocation){
navigator.geolocation .getCurrentPosition(GEOprocess,GEOdeclined);
} else {
alert('Your browser sucks。Upgrade it。');

函数GEOdeclined(错误){
alert('Error:'+ error.message);

函数GEOprocess(position){
alert('it works');

$ / code $ / pre

我得到这个错误

 错误:未知错误获取位置

它停止工作,只有当我升级我的FF到30.0

解决方案

现在我使用47 Mozilla。我已经尝试了一切,但所有的时间都是这个问题。然后我在地址栏中打开 about:config ,转到 geo.wifi.uri 并将其值更改为 a href =https://location.services.mozilla.com/v1/geolocate?key=test =nofollow noreferrer> https://location.services.mozilla.com/v1/geolocate?key=test 。
有效!


I am using Firefox 30.0(latest FF),navigator.geolocation.getCurrentPosition is working in Chrome but not in this version of FF.

Here is my code

    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');
}

I am getting this error

Error: Unknown error acquiring position

Note: It stoped working only when i upgrade my FF to 30.0

解决方案

Now I'm using 47 Mozilla. I have tried everything, but all time this problem. BUT then I open about:config in my address bar, go geo.wifi.uri and changed its value to "https://location.services.mozilla.com/v1/geolocate?key=test". works!

这篇关于navigator.geolocation.getCurrentPosition在Firefox 30.0中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆