Created
March 16, 2016 14:56
-
-
Save marxian/bd04b0c236cb817bf53b to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
</head> | |
<body> | |
<script> | |
function loolister () { | |
// Make a lovely button | |
var button = document.createElement('button'); | |
// label it | |
button.innerText = 'Find nearby loos'; | |
// Add a click handler | |
button.addEventListener('click', function() { | |
// Call the geolocation api with a callback | |
// in the call back get the lat and long and | |
// and construct an appropriate url | |
// make a request to the url | |
// parse the response | |
// loop over the features drawing some html | |
}); | |
// Add the button to the body | |
document.querySelector('body').appendChild(button); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment