Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MOREAU Elise
project-covid
Commits
fe4cac7f
Commit
fe4cac7f
authored
Oct 31, 2020
by
Moreau Elise
Browse files
get user's coordinates from navigator
parent
f5050bf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
templates/user/create_user.twig
View file @
fe4cac7f
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment