๋ฐ์ํ
์ฌ์ฉ ๊ธฐ๋ฅ
- ํ๋ฉด ์ ์ ์ฑ๊ณต์ alert ์ฐฝ ๋์ธ ์ ์๋๋ก ํจ
- ๊ธฐ์จ API ํ์ฉํ์ฌ ์จ๋ ๋ฐ์ดํฐ ๋ถ๋ฌ์์ ํ๋ฉด์ ๋์ ์ผ๋ก ๋์
- ์ ์ ์ธ ์จ๋๊ฐ ๋์น๋จ
- ๋๋จธ์ง๋ ๊ธฐ์กด์ ๋ง๋ค์ด๋์ ๊น์น๋ฏผ ๋ฉํผ ํฌ๋ช ๋ก์์ ๊ตฌํํ์์
์คํ๋ฅดํ ์น๊ฐ๋ฐ ๊ฐ๋ฐ ์ผ์ง ์์ฑ์ผ๋ก ์ธํ์ฌ ๊ธ ์์ฑ
์ฌ์ฉํ ์ฝ๋
์ฌ์ฉํ ์ฝ๋๋ ์๋์ ๊ฐ์
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<title>1์ฃผ์ฐจ ์์ </title>
<link href="https://fonts.googleapis.com/css2?family=Gowun+Dodum&display=swap" rel="stylesheet">
</head>
<style>
* {
font-family: 'Gowun Dodum', sans-serif;
}
#mytitle {
background-color: green;
width:100%;
height: 250px;
color: white;
background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("https://file.namu.moe/file/17a23b19305d0841bea89155d541c4d7f8117255ec2dbca20469b0ba3a71155b88896cb501dafff4fe6b04e59b382b82");
background-position: center;
background-size: auto;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.mypost {
max-width: 500px;
width: 95%;
margin: 20px auto 20px auto;
box-shadow: 0px 0px 3px 0px black;
padding: 20px;
}
.mypost > button {
margin-top: 15px;
}
.mycards {
width: 95%;
max-width: 500px;
margin: auto;
}
.mycards > .card {
margin-top: 20px;
margin-bottom: 10px;
}
</style>
<script>
$(document).ready(function(){
alert("๋ก๋ฉ ์ฑ๊ณต!")
})
$(document).ready(function(){
$.ajax({
type: "GET",
url: "http://spartacodingclub.shop/sparta_api/weather/seoul",
data: {},
success: function(response){
$('#temp').text(response['temp'])
}
})
});
/* $.ajax({
type: "GET",
url: "http://spartacodingclub.shop/sparta_api/seoulair",
data: {},
success: function(response) {
let rows = response['RealtimeCityAir']['row']
for (let i = 0; i < rows.length ; i++){
let gu_name = rows[i]['MSRSTE_NM']
let gu_mise = rows[i]['IDEX_MVL']
console.log(gu_name, gu_mise)
}
}
}) */
</script>
<body>
<div id="mytitle">
<h1>๊น์น๋ฏผ ํฌ๋ช
๋ก</h1>
<p>ํ์ฌ ๊ธฐ์จ : <span id="temp">1๋</span>๋</p>
</div>
<div class="mypost">
<div class="form-floating mb-3">
<input type="text" class="form-control" id="floatingInput" placeholder="name@example.com">
<label for="floatingInput">๋๋ค์</label>
</div>
<div class="form-floating">
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2" style="height: 100px"></textarea>
<label for="floatingTextarea2">์์ ๋๊ธ</label>
</div>
<button type="button" class="btn btn-dark">์์ ๋จ๊ธฐ๊ธฐ</button>
</div>
<div class="mycards">
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>์๋ก์ด ์จ๋ฒ ๋๋ฌด ๋ฉ์ ธ์!!!!!!!!</p>
<footer class="blockquote-footer"><cite title="Source Title">Tom</cite></footer>
</blockquote>
</div>
</div>
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>์๋ก์ด ์จ๋ฒ ๋๋ฌด ๋ฉ์ ธ์!!!!!!!!</p>
<footer class="blockquote-footer"><cite title="Source Title">Tom</cite></footer>
</blockquote>
</div>
</div>
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>์๋ก์ด ์จ๋ฒ ๋๋ฌด ๋ฉ์ ธ์!!!!!!!!</p>
<footer class="blockquote-footer"><cite title="Source Title">Tom</cite></footer>
</blockquote>
</div>
</div>
</div>
</div>
</body>
</html>
์ฝ๋์ ๊ดํ ์ง๋ฌธ์ ์ธ์ ๋ ์ง ๋๊ธ ๋ฐ๋๋๋ค.
๋ฐ์ํ
'๐๏ธ์ํํธ์จ์ด > ๐JavaScript' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Ajax, Flask] ๋ฒํท๋ฆฌ์คํธ ์น ํ์ด์ง ๋ง๋ค๊ธฐ (0) | 2022.09.23 |
---|---|
[ajax] post, get ๋ฐฉ์ ์ด์ฉํ ์น์ฌ์ดํธ ๋ง๋ค๊ธฐ (0) | 2022.09.22 |
[Vue.js] ๋ฌธ๋ฒ ๊ธฐ์ด 2ํธ(props, v-bind, v-on, router, axios) (0) | 2022.09.18 |
[Vue.js] ๋ฌธ๋ฒ ๊ธฐ์ด 1ํธ(props, v-bind, v-on, router, axios) (0) | 2022.09.18 |
์๋ฐ์คํฌ๋ฆฝํธ ๊ฐ์ฒด ๊ฐ๋ ์ด์ ๋ฆฌ (0) | 2022.08.11 |