Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getCurrentPosition() {
- if (navigator.geolocation)
- {
- navigator.geolocation.getCurrentPosition(
- function( position ) {
- alert(position.coords.latitude + ', ' +position.coords.longitude);
- },
- function( error ) {
- alert( "Something went wrong: ", error );
- },
- {
- timeout: (10 * 1000)
- }
- );
- }
- else {
- alert("Geolocation is not supported by this browser.");
- }
- }
Add Comment
Please, Sign In to add comment