wilson's story

[html5] 좌표값 가져오기 본문

HTML

[html5] 좌표값 가져오기

wilson 2012. 10. 22. 19:06
반응형

참고 : http://www.ibm.com/developerworks/kr/library/x-html5mobile1/ 

참고 : http://html5.firejune.com/doc.html
	window.onload = function() {
		var startPos;
		navigator.geolocation.getCurrentPosition(function(position) {
			startPos = position;
			document.getElementById('startLat').innerHTML = startPos.coords.latitude;
			document.getElementById('startLon').innerHTML = startPos.coords.longitude;
		});
	};
반응형