Jquery
${}: 즉시 적용(출력)
조건문 : if ~ A else B ~ - true면 A, false면 B
alert: 경고창 띠우기
$('#post-box').hide();
$('#post-box').css('display');
$('#post-box').show();
$('#post-box').css('display');
숨기기, 보이기
Ajax 기본
function q1() {
$.ajax({
type: "GET",
url: "주소",
data: {},
success: function (response) {
}
})
}
Ajax 기본 해설
$.ajax({
type: "GET", // GET 방식으로 요청한다.
url: "<http://openapi.seoul.go.kr:8088/6d4d776b466c656533356a4b4b5872/json/RealtimeCityAir/1/99>",
data: {}, // 요청하면서 함께 줄 데이터 (GET 요청시엔 비워두세요)
success: function(response){ // 서버에서 준 결과를 response라는 변수에 담음
console.log(response) // 서버에서 준 결과를 이용해서 나머지 코드를 작성
}
})
success: 성공하면, response 값에 서버의 결과 값을 담아서 함수를 실행한다.
02_ajaxquiz01.html
0.00MB
02_ajaxquiz02.html
0.00MB
02_ajaxquiz03.html
0.00MB
02_jquery.html
0.00MB
02_homework.html
0.01MB
'국비지원 웹개발 종합 (인강)' 카테고리의 다른 글
웹개발 종합반 4주차 (0) | 2022.01.05 |
---|---|
웹개발 종합반 3주차 (0) | 2022.01.01 |
웹개발 종합반 1주차 (0) | 2021.12.25 |
댓글