标签:
// 当前位置 function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { alert("暂时无法定位!"); } } function showPosition(position) { alert(position.coords.latitude + " " + position.coords.longitude); } window.onload = function () { getLocation(); }
标签:
原文地址:http://www.cnblogs.com/wln3344/p/4436880.html