Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:page>
- <!-- Begin Default Content REMOVE THIS -->
- <h1>Welcome </h1> Your Location is
- <div id="startLat">
- </div>
- <div id="startLon">
- </div>
- <script>
- window.onload = function() {
- var startPos;
- var geoSuccess = function(position) {
- startPos = position;
- document.getElementById('startLat').innerHTML = startPos.coords.latitude;
- document.getElementById('startLon').innerHTML = startPos.coords.longitude;
- };
- navigator.geolocation.getCurrentPosition(geoSuccess);
- };
- </script>
- </apex:page>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement