Safari 5中的地理位置

Sun*_*noy 12 safari html5 geolocation

我有一个使用HTML5地理位置报告我的位置的应用程序.该应用程序在Firefox和Chrome上运行正常,但在Safari 5上,它表示Safari不支持Geolocation.

从我读到的,Safari 5确实支持Geolocation.我错过了什么?

谢谢你的时间.

苏尼尔

and*_*nee 19

看起来Safari地理定位仅在与wifi连接时才有效.当使用有线连接连接时,Safari会从地理定位函数调用错误回调.

要对此进行测试,请在Web控制台中尝试:

navigator.geolocation.getCurrentPosition(
  function(){console.log("success")},
  function(){console.log("error")}
);
Run Code Online (Sandbox Code Playgroud)

使用Safari/wifi,这会在一两秒后返回"成功",但在有线连接上,它会立即返回"错误".

(使用Safari 5.1 - 8.x/Mac OSX 10.7 - 10.10)