목록전체 글 (203)
studyplan
이 값을 이렇게 바꾸려고한다 ! 저 댓글의 구조는 이렇게 되어있고 , 저 빨간색 박스가 알고리즘 영역이다 ! //날짜 포맷 변환 함수 function formatDate(datetime) { //문자열 날짜 데이터를 날짜객체로 변환 const dateObj = new Date(datetime); // 그냥은 못 가져오니까 Date 객체에 담는다 그러면 string 으로 받을수 있다 ! //날짜객체를 통해 각 날짜 정보 얻기 let year = dateObj.getFullYear(); //1월이 0으로 설정되어있음. let month = dateObj.getMonth() + 1; let day = dateObj.getDate(); let hour = dateObj.getHours(); let minute ..
저기에 리스트를 쫙! 불러올것이다 ! HTML 의 구성은 이렇게 되어있고 자바스크립트로 빨간색 박스에 넣어줄 것이다 ! 자바스크립트로 불러와 보자 ! 주소는 여기이고 이렇게 서버에서 가져올 것이다 function showReplies(pageNum = 1) { fetch(URL + '?boardNo=' + bno + '&pageNum=' + pageNum) .then(res => res.json()) .then(replyMap => { makeReplyDOM(replyMap); }); } function showReplies(pageNum = 1) { showReplies 함수의 기본값은 1 fetch(URL + 'boardNo=' + bno + '&pageNum=' + pageNum) 이렇게 넣으면 ...
String s0 = s.substring(0); String s2 = s.substring(2); String s02 = s.substring(0, 2); System.out.println("============="); System.out.println(s0); System.out.println(s2); System.out.println(s02); System.out.println("============="); String s5 = s.substring(s.lastIndexOf("5")); String s4 = s.substring(s.lastIndexOf("4")); System.out.println(s5); System.out.println(s4); String s55 = s.substring(..
https://spring.io/guides/gs/uploading-files/ Uploading Files this guide is designed to get you productive as quickly as possible and using the latest Spring project releases and techniques as recommended by the Spring team spring.io # file upload max-size spring.servlet.multipart.max-file-size=20MB spring.servlet.multipart.max-request-size=20MB application.properties 에 넣어야 된다
저번 포스팅에 이어서 삭제 버튼을 만들어 보겠다 // 삭제버튼 이벤트 $ul.onclick = e => { if (!e.target.matches('.del-btn')) return; const rno = e.target.parentElement.dataset.rno; fetch(url + '/' + rno, { method: 'DELETE' }) .then(res => { if (res.status === 200) { return res.text(); } return null; }) .then(msg => { if (msg === 'del-success') { alert('삭제 성공!'); } else { alert('삭제 실패!'); } }) .catch(err => alert('통신 실패!')) }..
html 구조 ! const boardNo = 300; const url = 'http://localhost:8183/api/v1/replies'; fetch(url + '?boardNo=' + boardNo) .then(res => res.json()) .then(replyMap => { makeReplyDOM(replyMap.replyList); }); ------------------------------------------------------------------------------- fetch(url + '?boardNo=' + boardNo) // http://localhost:8183/api/v1/replies'에 boardNo 인 데이터를 가져옴 then. 그래서 가져온게 res 인데..
const boardNo = 259; const url = 'http://localhost:8183/api/v1/replies'; fetch(url + '?boardNo=' + boardNo) .then(res => res.json()) .then(replyMap => { makeReplyDOM(replyMap.replyList); }); ------------------------------------------------------------------------------- fetch(url + '?boardNo=' + boardNo) // http://localhost:8183/api/v1/replies'에 boardNo 인 데이터를 가져옴 then. 그래서 가져온게 res 인데 res를 json..