navigator.geolocation.getCurrentPosition 在 Firefox 30.0 中不起作用 [英] navigator.geolocation.getCurrentPosition do not work in Firefox 30.0
问题描述
我使用的是 Firefox 30.0(最新的 FF),navigator.geolocation.getCurrentPosition
在 Chrome 中工作,但在这个版本的 FF 中没有.
I am using Firefox 30.0 (latest FF), and navigator.geolocation.getCurrentPosition
is working in Chrome but not in this version of 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');
}
我收到此错误:
Error: Unknown error acquiring position
注意:将 Firefox 升级到 30.0 版后停止工作
Note: It stopped working after upgrading Firefox to version 30.0
推荐答案
现在我用的是 47 Mozilla.我已经尝试了一切,但一直都是这个问题.BUT 然后我在地址栏中打开 about:config,转到 geo.wifi.uri 并将其值更改为https://location.services.mozilla.com/v1/geolocate?key=test".有效!
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屋!