코딩공부 2주차

덴슈·2022년 3월 30일
0

ajax, json 기초
어렵당
_
!@#///
$(document).ready(function () {
q1()
});
function q1() {
$.ajax({
type: "GET",
url: "http://spartacodingclub.shop/sparta_api/rate",
data: {},
success: function (response) {
let rows = response['rate'];
$('#rows').text(rows);
}
})
}
function buy() {
alert('주문이 완료되었습니다.')
}
##///

** ##///

    <p>달러-원 환율:<span id="rows">1111</span></p>
##///</div>

**

** ##/// function q1() {
$.ajax({
type: "GET",
url: "https://api.thecatapi.com/v1/images/search",
data: {},
success: function (response) {
let imgurl = response[0]['url'];
$("#img-cat").attr("src", imgurl);
}
})
}
///!@###
_

****
profile
공부

0개의 댓글