if (navigator.geolocation) { console.log("h5 定位中"); navigator.geolocation.getCurrentPosition(function(position) { var latitude = position.coords.latitude; var longitude = position.coords.longitude; alert(latitude) alert(longitude) alert('h5定位成功;'); }, function(error) { console.log('h5定失敗;'); })}我直接在靜態文件中打開為什么不行總是打印定位失敗但是在手機上是可以的瀏覽器也是支持的啊 為什么不能定位
H5定位地理位置
夢里花落0921
2019-02-05 23:11:52