HTML5 GeoLocation API - no callback is called whatsoever

余生颓废 提交于 2019-12-03 21:16:23

Not much you can do about this. You're at the whim of the browser developers and how they attempt to figure out your location based on WiFi Access Point fingerprinting, or IP lookup.

Out of curiosity, I tested the code (http://jsfiddle.net/YbtSZ/2/) on the following browsers and found it worked inconsistently.

Mac 10.7.2

  • Chrome on Mac - works
  • FF 9 on Mac - works
  • Safari on Mac - does NOT work

XP native

  • FF 9 on XP - works
  • IE 8 on XP - does NOT work (Geolocation NOT supported)

XP running virtualised in Mac

  • Chrome on XP (virtualised in Mac) - does NOT work (POSITION UNAVAILABLE)
  • FF 9 on XP (virtualised in Mac) - does NOT work (POSITION_UNAVAILABLE)
  • IE 8 on XP (virtualised in Mac) - does NOT work (Geolocation NOT supported)

You might want to try Modernizr, it's a JavaScript library that abstracts away HTML5 features so you get consistent results. Check out the docs for more information.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!