Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김대철
/
CafeRecommend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
최정민
2021-06-02 08:47:26 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8534377663c0d64338169d88ff6a8d5176b82d3d
85343776
1 parent
00621b6c
FEAT : ajax버튼을 이용한 api
-
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
routes/index.js
sessions/9U-KSMqwcMz_vyjOhJG6fflsWrunACqV.json
views/map.ejs
routes/index.js
View file @
8534377
...
...
@@ -277,8 +277,8 @@ router.get("/recommend", function (req, res) {
if
(
err
)
{
console
.
log
(
err
);
}
else
if
(
row
.
length
>
0
)
{
console
.
log
(
row
);
res
.
send
(
row
);
console
.
log
(
row
[
0
].
CAFE_ID
);
res
.
send
(
{
result
:
row
}
);
}
});
}
...
...
sessions/9U-KSMqwcMz_vyjOhJG6fflsWrunACqV.json
0 → 100644
View file @
8534377
{
"cookie"
:{
"originalMaxAge"
:
null
,
"expires"
:
null
,
"httpOnly"
:
true
,
"path"
:
"/"
},
"__lastAccess"
:
1622591147463
,
"user"
:{
"email"
:
"cjm2021401@khu.ac.kr"
,
"picture"
:
"https://lh3.googleusercontent.com/a/AATXAJzFD3R6CaL2NpysVrfvdGqcQ83vh_wpbN_5hj-0=s96-c"
,
"nickname"
:
"초보베이시스트"
,
"age"
:
16
,
"gender"
:
"male"
}}
\ No newline at end of file
views/map.ejs
View file @
8534377
...
...
@@ -158,6 +158,8 @@
<div
class=
"col-1"
></div>
</div>
<button
type=
"button"
id=
'Recommend'
class=
"btn btn-primary"
onclick=
"recommend();"
>
추천
</button>
<p
id=
'test'
></p>
</section>
<script
...
...
@@ -165,6 +167,22 @@
src=
"//dapi.kakao.com/v2/maps/sdk.js?appkey=68cbccbcd6f0fef0a213e62ad37393ee&libraries=services"
></script>
<script>
function
recommend
(){
$
.
ajax
({
url
:
'/recommend'
,
type
:
'GET'
,
success
:
function
(
result
){
if
(
result
)
{
$
(
'#test'
).
html
(
result
.
result
[
0
].
CAFE_ID
);
}
}
});
}
</script>
<script>
var
lat
=
""
;
var
lon
=
""
;
var
placeOverlay
=
new
kakao
.
maps
.
CustomOverlay
({
zIndex
:
1
});
...
...
Please
register
or
login
to post a comment