Toggle navigation
Toggle navigation
This project
Loading...
Sign in
zuzitsu
/
UR_Village
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
이학주
2020-12-01 19:17:14 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
de56bf217dd97117fea9edf0a969dece63389eb6
de56bf21
1 parent
3873b4d8
Modify variable names
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
routes/select.js
views/index.pug
views/select.pug
routes/select.js
View file @
de56bf2
...
...
@@ -9,8 +9,8 @@ require('dotenv').config();
router
.
post
(
'/'
,
function
(
req
,
res
)
{
console
.
log
(
req
.
body
);
let
userSi
=
req
.
body
.
si
let
user
Ku
=
req
.
body
.
ku
;
let
userLocation
=
`
${
userSi
}
${
user
Ku
}
`
;
let
user
Dong
=
req
.
body
.
dong
;
let
userLocation
=
`
${
userSi
}
${
user
Dong
}
`
;
let
xyList
=
[];
console
.
log
(
userLocation
);
let
YOUR_API_KEY
=
process
.
env
.
KAKAO_APIKEY
;
...
...
@@ -34,7 +34,7 @@ router.post('/', function(req, res) {
console
.
log
(
xyList
);
}
})
res
.
render
(
'select'
,
{
'si'
:
req
.
body
.
si
,
'
ku'
:
req
.
body
.
ku
});
res
.
render
(
'select'
,
{
'si'
:
req
.
body
.
si
,
'
dong'
:
req
.
body
.
dong
});
});
module
.
exports
=
router
;
\ No newline at end of file
...
...
views/index.pug
View file @
de56bf2
...
...
@@ -17,20 +17,20 @@ html
if (this.readyState == 4) {
var result = JSON.parse(this.responseText);
var d = [];
var
c
= [];
var d
ong_name
= [];
var
dong_code
= [];
for(var i=0; i<result["admVOList"]["admVOList"].length; i++){
d.push(result["admVOList"]["admVOList"][i].lowestAdmCodeNm);
c
.push(result["admVOList"]["admVOList"][i].admCode);
d
ong_name
.push(result["admVOList"]["admVOList"][i].lowestAdmCodeNm);
dong_code
.push(result["admVOList"]["admVOList"][i].admCode);
}
console.log(
c
);
var target = document.getElementById("
ku
");
console.log(
dong_code
);
var target = document.getElementById("
dong
");
target.options.length = 0;
for (x in d) {
for (x in d
ong_name
) {
var opt = document.createElement("option");
opt.value =
c
[x];
opt.innerHTML = d[x];
opt.value =
dong_code
[x];
opt.innerHTML = d
ong_name
[x];
target.appendChild(opt);
}
...
...
@@ -99,8 +99,8 @@ html
</select>
</div>
<div class="form-group col-sm-4">
<label for="
ku
">동</label>
<select class="form-control" id="
ku" name="ku
">
<label for="
dong
">동</label>
<select class="form-control" id="
dong" name="dong
">
<option>선택해주세요.</option>
</select>
</div>
...
...
views/select.pug
View file @
de56bf2
...
...
@@ -5,7 +5,7 @@ html
button k
body
block content
h1 당신의 동네 : #{si} #{
ku
}
h1 당신의 동네 : #{si} #{
dong
}
.row
.col.s12.m7
.card(style='background-color: skyblue; display: inline-block;')
...
...
Please
register
or
login
to post a comment