Skip to content
Snippets Groups Projects
Commit fe4cac7f authored by Moreau Elise's avatar Moreau Elise
Browse files

get user's coordinates from navigator

parent f5050bf4
Branches
No related tags found
No related merge requests found
......@@ -51,4 +51,13 @@
</div>
</form>
</div>
<script>
window.addEventListener('load', function(){
if (!navigator.geolocation) { return; }
navigator.geolocation.getCurrentPosition(function(position) {
console.log(position.coords.latitude, position.coords.longitude);
});
});
</script>
{% endblock %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment