HTML5地理位置API在Firefox中不起作用

时间:2018-09-18 09:49:12

标签: javascript html5 geolocation

我尝试执行W3schools代码以通过HTML5 Geolocation API获取经度和纬度。除了在Firefox中,它还可以在Chrome中使用。

这是W3schools代码:Geolocation try it的链接。

通过谷歌搜索,我发现的建议是在Windows的admin模式下运行Firefox。我试过了,但是没用。

我的firefox版本是57.0.4。

您知道为什么地理定位API在firefox中不起作用吗?

1 个答案:

答案 0 :(得分:1)

我只是在我的本地主机上尝试过,它对我有用,当我单击该按钮时,firefox要求我允许位置访问,请确保您也降低了位置访问权限。

enter image description here