
제가 javascript에 대한 이해가 좀 떨어집니다. 일단 숙제를 하고 3주차 수업을 따라가면서 2주차 학습내용을 천천히 복습해 보겠습니다.
2주차 숙제에서 현재 온도에 대한 temp 값을 못받아옵니다. 어디가 잘못되었나요
octype 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>
<style>
.mytitle{
background-color: green;
height: 250px;
width: 100%;
background-image: url("http://www.kogl.or.kr/upload_recommend/%ED%82%A4%EC%9B%8C%EB%93%9C%20%EC%A0%80%EC%9E%91%EB%AC%BC/%EB%8C%80%EC%A0%84%EA%B4%91%EC%97%AD%EC%8B%9C/%EB%AC%B4%EC%8A%A8%20%EC%82%AC%EC%A7%84%EC%9D%BC%EA%B9%8C/%EA%B3%B5%EB%AA%A8%EC%A0%84_0201_%ED%95%B4%EC%A7%88%20%EB%AC%B4%EB%A0%B5%EC%9D%98%20%EA%B0%80%EC%9D%84%20%EC%A0%95%EC%9B%90.jpg");
background-size: cover;
background-position: center;
color: white;
display:flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.mytitle > button {
width: 200px;
height: 50px;
background-color: transparent;
color: white;
border-radius: 50px;
border: 1px solid white;
margin-top: 20px;
}
.mytitle > button:hover{
border: 3px solid white;
}
.mycomment{
color: red;
}
. wrap{
max-width: 1200px;
width: 95%;
margin: 20px auto opx auto;
}
.mypost{
max-width: 500px;
width: 95%;
margin: 10px auto 10px auto;
box-shadow: 0px 0px 3px 0px red;
padding: 20px;
}
.mybutton{
display:flex;
flex-direction: row;
justify-content: left;
align-items: center;
margin-top: 10px;
}
.mybutton > button{
margin-right: 10px;
}
.text{
}
</style>
<scrip>
$(document).ready(function(){
$.ajax({
type : "GET"
url : "http://http://spartacodingclub.shop/sparta_api/weather/seoul",
data : {},
success : function(response){
let temp = response['temp']
$(`#temp`).text(temp)
}
})
}
</scrip>
</head>
<body>
<div class="mytitle">
<h1> 윤도현 사랑해요</h1>
<p class="aaa"> 현재기온 : <span id="temp"00.0도</p>
</div>
<div class="mypost">
<div class="form-floating mb-3">
<div class="form-floating">
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2"></textarea>
<label for="floatingTextarea2">닉네임</label>
</div>
<div class="form-floating">
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2"></textarea>
<label for="floatingTextarea2">사랑해</label>
</div>
<div class="mybutton">
<button type="button" class="btn btn-dark">멋져요</button>
</div>
</div>
</div>
<div>
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>새로운 엘범 넘 멋져요.</p>
<footer class="blockquote-footer">홍길동 </footer>
</blockquote>
</div>
</div>
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>새로운 엘범 넘 멋져요.</p>
<footer class="blockquote-footer">개똥이 </footer>
</blockquote>
</div>
</div>
</div>
</body>
