Which Devices Support Javascript Geolocation via navigator.geolocation?

前端 未结 7 2140
没有蜡笔的小新
没有蜡笔的小新 2020-11-29 00:28

The iPhone supports geolocation in mobile Safari via the following call:

navigator.geolocation.getCurrentPosition(
  function(pos){
    var lat = pos.coords.         


        
7条回答
  •  清酒与你
    2020-11-29 01:08

    As of today, the W3C Geolocation API (widely associated with, though not technically part of, HTML 5) is support in the following major desktop browsers:

    • Firefox (since 3.5)
    • Safari (since 5.0)
    • Google Chrome (version depends on OS)
    • Opera (since 10.60)
    • Internet Explorer (since IE 9)

    There are at least two mobile browsers that implement the Geolocation API:

    • Safari Mobile (since iPhone OS 3.0)
    • Android (since at least Android 1.6)

    On all of these platforms, you should be able to use navigator.geolocation.getCurrentPosition, etc.

提交回复
热议问题