16年1月7日- $(function(){
- window.onload = function(){
- navigator.geolocation.getCurrentPosition(
- function(pos){
- alert("current latitude:------"+pos.coords.latitude
- +"current longitude:-------"+pos.coords.longitude
- +"current accuracy of position:--------"+pos.coords.accuracy);
- },function(){alert("无法定位");});
- }
- })
复制代码 |