if (window.navigator.geolocation) { alert("支持地理定位"); }else{ alert("不支持"); }
var geo=window.navigator.geolocation; geo.getCurrentPosition(function (pos){ console.log(pos); });
HTML5自带的原生定位
原文:http://www.cnblogs.com/pan-hello/p/4568653.html