<script>
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);
@@ #img-cat을 imgurl로 이미지를 대체하기 @@
}
})
}
</script>