Created
August 29, 2013 08:41
-
-
Save hkongm/6375666 to your computer and use it in GitHub Desktop.
HTML5 API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ("geolocation" in navigator) { | |
navigator.geolocation.getCurrentPosition(function(position) { | |
var jingdu = position.coords.longitude, // 经度 | |
weidu = position.coords.latitude; // 纬度 | |
}); | |
} else { | |
alert('您的浏览器不支持地理位置查询!'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment