Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HealthTech
Hospital Recommendations
Commits
bf90a9fb
Commit
bf90a9fb
authored
Jul 24, 2019
by
gouri lahare
Browse files
Add new file
parent
6b92dd12
Changes
1
Hide whitespace changes
Inline
Side-by-side
current.html
0 → 100644
View file @
bf90a9fb
<!DOCTYPE html>
<html>
<body>
<p><b>
Click the button bellow to get your coordinates.
<b></p>
<button
onclick=
"getLocation()"
>
Try It
</button>
<p
id=
"demo"
></p>
<script>
var
x
=
document
.
getElementById
(
"
demo
"
);
function
getLocation
()
{
if
(
navigator
.
geolocation
)
{
navigator
.
geolocation
.
getCurrentPosition
(
showPosition
);
}
else
{
x
.
innerHTML
=
"
Geolocation is not supported by this browser.
"
;
}
}
function
showPosition
(
position
)
{
x
.
innerHTML
=
"
Latitude:
"
+
position
.
coords
.
latitude
+
"
<br>Longitude:
"
+
position
.
coords
.
longitude
;
}
</script>
</body>
</html>
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