์ธ๊ณ ๊ฐ์..
๋นผ์ ์ ์ ์ ์ ์ก
์ ์๋ : ์~ ์ด๋ฒ์ ๋ด์ด๋๋ฆฐ ํด์ฆ๋ 10๋ถ์ ๋ ๋๋ฆดํ
๋ ํด๋ณด์๊ณ
ํ์ ๊ฐ์ด ํ ๋ฒ ํด๋ณด๊ฒ ์ต๋๋ค. :)
๋ : ์.. 10๋ถ์ด๋ฉด ์ฌ์ด ๋ฌธ์ ์ธ๊ฐ๋ค ^^
๊ป์ด๊ฒ ๋ค~~
[50๋ถ ๋ค]
๋ :
์ถ์ฒ : ๋ค์ด๋ฒ์นํฐ
<!doctype html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>JQuery ์ฐ์ตํ๊ณ ๊ฐ๊ธฐ!</title>
<!-- JQuery๋ฅผ import ํฉ๋๋ค -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<style type="text/css">
div.question-box {
margin: 10px 0 20px 0;
}
div.question-box > div {
margin-top: 30px;
}
</style>
<script>
function q1() {
// ์ฌ๊ธฐ์ ์ฝ๋๋ฅผ ์
๋ ฅํ์ธ์
// $('#img-cat').empty()
$.ajax({
type: "GET",
url: "https://api.thecatapi.com/v1/images/search",
data: {},
success: function (response) {
let cat = response[3]
for (let i = 0; i < cat.length; i++) {
let catPick = cat[i]['url']
console.log(catPick)
// $("#img-cat").attr("src", imgurl);
}
}
})
}
</script>
</head>
<body>
<h1>JQuery+Ajax์ ์กฐํฉ์ ์ฐ์ตํ์!</h1>
<hr/>
<div class="question-box">
<h2>3. ๋๋ค ๊ณ ์์ด ์ฌ์ง API๋ฅผ ์ด์ฉํ๊ธฐ</h2>
<p>์์ ๊ณ ์์ด ์ฌ์ง์ ๋ณด์ฌ์ฃผ์ธ์</p>
<p>์
๋ฐ์ดํธ ๋ฒํผ์ ๋๋ฅผ ๋๋ง๋ค ์ง์ ๋ค ์๋ก ์์ฌ์ ธ์ผ ํฉ๋๋ค.</p>
<button onclick="q1()">๊ณ ์์ด๋ฅผ ๋ณด์</button>
<div>
<img id="img-cat" src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"/>
</div>
</div>
</body>
</html>
๋ง์ ์๋ ๋์ ํฌ๊ธฐํ ์ฝ๋..
์๋ฌด๊ฒ๋ ๋ชปํ๋ค..
์ง์ง ์๋ ๋ชป๋๊ณ ์๋ฌด๊ฒ๋ ๋ชปํ๋ค..
๋ฉํ ์์ ๋ชจ๋ ๊ฒ ๋ค ์์ฅ์ฐฝ ๋ ๊ธฐ๋ถ..
์๋.. ๋ฐฐ์ด ๊ฑธ ๊ฐ์ง๊ณ ์จ๋จน๋๊ฑฐ ์๋๊ฐ..?
๋ฐฐ์ด ๊ฒ๋ ์๋ ์คํฌ๊ณผ ์์ฉ๋ฒ์ผ๋ก ํด๋ณด๋ผ ํ๊ณ ๋ ์ง์ ํด์ ๋์ค๋๊ฒ ์ด๋ ์ฌ์ด ์ผ์ธ๊ฐ..
๋ด ๋ฌด๊ธฐ๋ ฅํจ์ ์ข์ ..
๋๋ณด๊ธฐ
๋๋ณด๊ธฐ
ํ ~ ๋ปํ์ง๋ง~ ์ด๋ฐ๊ฑธ๋ก ์ ๋ ํฌ๊ธฐํ์ง ์์ง..!!!
๊ทธ๋ ์ธ์ ๋ ์ง ๋ ๊ฐ๋ ๊ฐ์ ๋ฌธ์ ๋ค ์๋ผ ํฌ๊ธฐํ๊ฒ ๋ง๋๋ ๋ฌธ์ ๋ ๋ญ๋ ๋ค ๋๋ฃจ์!!
์ ๋ ํฌ๊ธฐ ์ํ๋ค!!
์ด ์
๋ฌผ๊ณ ๋ฒํด๋ค!!!
์์์ฃ!!!