Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- ํ ์ด๋ธ
- MySQL
- JS
- Update
- DATE_FORMAT
- ๋ฐฑํฑ
- oracle
- SQL
- optionํ๊ทธ
- ์ฝํ
- ํจ์
- ๋์ปค
- JavaScript
- ์๋ฐ์คํฌ๋ฆฝํธ
- ๋์ ํ ์ด๋ธ
- ์ธ๋ผ์ธ๋ทฐ
- select
- post๋ฐฉ์
- Spring
- ๋ฆฌ๋ ์ค
- Ajax
- order by
- like
- JSP
- ๋ช ๋ น์ด
- ๋ฐฐ์ด
- ๋ณ์
- ๋์
- ํ๋ก๊ทธ๋๋จธ์ค
- ์ปจํธ๋กค๋ฌ
Archives
- Today
- Total
bom's happy life
[์น ๊ฐ๋ฐ 3 ์ฃผ์ฐจ] ๊ฐ๋ฐ์ผ์ง 12 - API์ฃผ์ ๊ฐ์ ธ์ค๊ธฐ, for ๋ฌธ ๋ณธ๋ฌธ
Deveolpment Study๐๏ธ/Javascript
[์น ๊ฐ๋ฐ 3 ์ฃผ์ฐจ] ๊ฐ๋ฐ์ผ์ง 12 - API์ฃผ์ ๊ฐ์ ธ์ค๊ธฐ, for ๋ฌธ
bompeach 2022. 5. 31. 13:413์ฃผ์ฐจ ์์ ๋ชฉํ
1. ํ์ด์ฌ ๊ธฐ์ด ๋ฌธ๋ฒ์ ์๋ค.
2. ์ํ๋ ํ์ด์ง๋ฅผ ํฌ๋กค๋ง ํ ์ ์๋ค.
3. pymongo๋ฅผ ํตํด mongoDB๋ฅผ ์ ์ดํ ์ ์๋ค.
[์ฝ๋์ค๋ํซ] ๋ก๋ฉ ํ ๋ฐ๋ก์คํ
<script>
$(document).ready(function () {
listing();
});
function listing() {
console.log('ํ๋ฉด ๋ก๋ฉ ํ ์ ์คํ๋์์ต๋๋ค');
}
url : API์ฃผ์ ๋ฐ๊ฟ์ฃผ๊ณ ,
๊ฐ์ ธ์ค๊ณ ์ถ์ ๋ฐ์ดํฐ ์ง์ ?,,,,,,
let rows = response['movies'] → [ ] ์์ ๋ค์ด๊ฐ๋ ๊ฑฐ๋ API์ฃผ์์ ์๋ ๋์ฃผ์ (?)
๊ทธ๋ฆฌ๊ณ ๋์ console.log์ ๋ค์ด๊ฐ์ rows ์ ๋ณด๋ฅผ ์ ๋ํ๋ด์ฃผ๋์ง ํ์ธ! (ํ์ธํ๊ณ ๋์ด๊ฐ์ผ ์๋ฌ๊ฐ ๋ฌ์ ๋ ์ฝ๊ฒ ์์ )
↓
$(document).ready(function () {
listing();
});
function listing() {
$.ajax({
type: "GET",
url: "http://spartacodingclub.shop/web/api/movie",
data: {},
success: function (response) {
let rows = response['movies']
console.log(rows)
๋ฐ์์ ๊ฐ์ด ๋จ๋ฉด ์ฑ๊ณต. rows ๊ฐ ๊ฐ์ ธ์จ๊ฑฐ ์ฝ์์ฐฝ์ ๋ฌ๊ฑฐ์.
↓
for ๋ฌธ
success: function (response) {
let rows = response['movies']
for (let i = 0; i < rows.length; i++)
}
'Deveolpment Study๐๏ธ > Javascript' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Javascript ๋ณ์์ prompt( ) ํ์ฉํ๊ธฐ (0) | 2022.07.22 |
---|---|
Javascript ๋ณ์๋? (0) | 2022.07.22 |
[์น ๊ฐ๋ฐ 2 ์ฃผ์ฐจ] ๊ฐ๋ฐ์ผ์ง 11 - jQuery + Ajax์ ์กฐํฉ ์ฐ์ต (0) | 2022.05.30 |
[์น ๊ฐ๋ฐ 2 ์ฃผ์ฐจ] ๊ฐ๋ฐ์ผ์ง 10 - Ajax (0) | 2022.05.30 |
[์น ๊ฐ๋ฐ 2 ์ฃผ์ฐจ] ๊ฐ๋ฐ์ผ์ง 9 - jQuery (0) | 2022.05.26 |