Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강희주
/
Music_Recommendation_Website
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
진재영
2022-05-30 23:31:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3f869953b9c4114aee8420dcb61d0698f57c477b
3f869953
1 parent
b783ed6a
gps_api file deleted to replace WeatherAPI branch
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
31 deletions
gps_api/example.html
gps_api/practice.js
gps_api/example.html
deleted
100644 → 0
View file @
b783ed6
<!DOCTYPE html>
<html
lang=
"ko"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
Geolocation example - getCurrentPosition()
</title>
</head>
<body>
<script
type=
"text/javascript"
src=
"practice.js"
></script>
</body>
</html>
gps_api/practice.js
deleted
100644 → 0
View file @
b783ed6
if
(
navigator
.
geolocation
)
{
navigator
.
geolocation
.
getCurrentPosition
(
success
,
error
);
}
else
{
alert
(
"Your browser is not support geolocation."
)
//navigator이 현재 브라우저에서 작동하지 않는 경우
}
function
success
(
position
)
{
var
latitude
=
position
.
coords
.
latitude
;
var
longitude
=
position
.
coords
.
longitude
console
.
log
(
`Your latitude is
${
latitude
}
and your longitude is
${
longitude
}
`
)
// 위도와 경도 값을 console로 알려줌
return
(
latitude
,
longitude
);
}
function
error
()
{
alert
(
"Can't detect your location. Try again later."
)
// error function
}
\ No newline at end of file
Please
register
or
login
to post a comment