Created
July 23, 2015 03:56
-
-
Save etoxin/94317c1d0cb89e667d59 to your computer and use it in GitHub Desktop.
mongo example
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Boom!</title> | |
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script> | |
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> | |
<script> | |
var stuff = { | |
run: function () { | |
$('button').bind('click', function () { | |
if ('geolocation' in navigator) { | |
var geo_options = { | |
enableHighAccuracy: true, | |
maximumAge : 30000, | |
timeout : 27000 | |
}; | |
navigator.geolocation.getCurrentPosition(stuff.send, stuff.error, geo_options); | |
} | |
}); | |
}, | |
error: function (msg) { | |
console.log(msg); | |
}, | |
send: function (object) { | |
console.log(object); | |
} | |
}; | |
$(function() { | |
stuff.run(); | |
}); | |
</script> | |
</head> | |
<body> | |
<div class="container"> | |
<h1>Geolocation.</h1> | |
<p> | |
<button class="btn btn-large">Press Me!</button> | |
</p> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment