JAVASCRIPT(3)
-
즉시 실행 함수 2023.02.23
-
업로드 input 추가 , 파일 선택시 이미지 추출
#div-file button{position: relative; right: -73px; top: -97px; z-index: 10; display: none; } 파일업로드 파일업로드 var cnt = 1; function fileAppend(){ var fileElement = "" + ""; //jQuery의 append() : html 태그를 추가 $("#div-file").append(fileElement); cnt++; } function fileRemove(){ // $("#div-file button").find() $("#div-file").empty(); } // 삭제버튼 선택시 동작 함수 function resetInput(obj){ var imgTag = obj.previousSi..
2023.02.17 -
AJAX
function showList(){ $.ajax({ url:"", type:"get", //서버에 전송방식 dataType:"json", //응답형식 success:resultList, //resultList 콜백함수 error:function(){alert("error")} }) function resultList(data){ //서버에서 응답한데이터(json형태로 리턴받은것이 data) conlsole.log(data); } } 컨트롤러 @RequestMapping("/memberAjaxList.do") public List memberAjaxList(){ List memberList = dao.memberList(); return memberList; } jackson 라이브러리 pom.xml에추..
2023.02.16