JQuery(4)
-
Ajax 사용방법
// 방법1 예전방식 $.ajax({ url: "/send", // 데이터를 요청할 url type: "GET", // GET, POST, DELETE, PATCH, PUT 등 data : data, // 보내고 싶은 데이터를 JSON 형식으로 작성 success: function(result){ // 요청에 성공했을때 실행되고 서버에서 받은 데이터를 확인할수 있다 console.log(result); }, error: function(){ console.log("에러발생"); } }) // 방법2 추천방식 $.ajax({ url: "/send", type: "GET", data : data, }) .done(function(result){ // 요청에 성공했을때 실행 console.log(result)..
2021.11.26 -
선택된 input[type="checkbox"] 값 가져오기
1번 2번 3번 버튼
2021.11.24 -
swal 사용방법
CDN 붙여넣기 간단하게 사용 swal("텍스트"); 옵션 넣기 swal({ text : "텍스트", closeOnClickOutside : false // 백그라운드 클릭해도 안꺼짐 }) .then(function(result){ // 창 꺼질때 실행할 함수 console.log(result); // background 클릭 => null // 확인버튼 클릭 => true if(result) { location.href = "/"; } }) confirm창 swal({ text : "텍스트", buttons: ["취소" , "이동"] }) .then(function(result){ console.log(result); if(result){ location.href = "/"; } })
2021.11.24 -
선택된 input[type="radio"] 값 가져오기
1번 2번
2021.11.24