Geolocation in Safari 5(Safari 5 中的地理位置)
问题描述
我有一个使用 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 中的地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Safari 5 中的地理位置


- addEventListener 在 IE 11 中不起作用 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- Fetch API 如何获取响应体? 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- 失败的 Canvas 360 jquery 插件 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01