我有一个使用 HTML5 地理位置报告我的位置的应用程序.该应用程序在 Firefox 和 Chrome 上运行正常,但在 Safari 5 上,它说 Safari 不支持地理定位.
I have a application which reports my location using HTML5 geolocation. The application works correct on Firefox and Chrome, but on Safari 5, it says that Safari does not support Geolocation.
根据我的阅读,Safari 5 确实支持地理定位.我错过了什么?
From what I read, Safari 5 does support Geolocation. What am I missing?
感谢您的宝贵时间.
苏尼尔
看起来 Safari 地理位置只有在连接 wifi 时才有效.当通过有线连接连接时,Safari 会从地理定位函数调用错误回调.
Looks like Safari geolocation only works when connected with wifi. When connected with a wired connection Safari calls the error callback from the geolocation functions.
要对此进行测试,请在 Web 控制台中尝试:
To test this, try this in the web console:
navigator.geolocation.getCurrentPosition(
function(){console.log("success")},
function(){console.log("error")}
);
对于 Safari/wifi,它会在一两秒后返回成功",但在有线连接上它会立即返回错误".
With Safari/wifi this returns 'success' after a second or two, but on a wired connection it returns 'error' immediately.
(使用 Safari 5.1 - 8.x/Mac OSX 10.7 - 10.10)
( using Safari 5.1 - 8.x / Mac OSX 10.7 - 10.10 )
这篇关于Safari 5 中的地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Angular 2:在本地 .json 文件中找不到文件Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
使用模式 Angular 2 进行输入验证Input validation with pattern Angular 2(使用模式 Angular 2 进行输入验证)
如何在角度2中动态更改css类名How to change the css class name dynamically in angular 2(如何在角度2中动态更改css类名)
如何删除输入类型中的默认颜色?How to remove default color in input type?(如何删除输入类型中的默认颜色?)
如何将点击事件添加到打字稿中动态添加的html元How to add click event to dynamically added html element in typescript(如何将点击事件添加到打字稿中动态添加的html元素)
XPath 具有条件的多个属性值之一XPath one of multiple attribute values with condition(XPath 具有条件的多个属性值之一)