목록JAVASCRIPT&JQUERY (23)
기록
if(newData.cdId){ ==> newData.cdId가 truthy한 값일때, 즉 양의정수,음의정수,양의실수,음의실수, 문자열 등 } if(!newData.cdId){ ==> newData.cdId가 falsy한 값일때 즉 false, 0, ''(빈문자열), null, undefined, NaN 값일때 만약 newData에 cdId속성이 존재하지 않으면 undefined 로 간주하고 이 조건문을 타게 된다. }
const toDoForm = document.querySelector("#todo-form"); const toDoInput = toDoForm.querySelector("input"); //const toDoInput = document.querySelector("#todo-form input"); const toDoList = document.querySelector("#todo-list"); function deleteToDo(event){ const li = event.target.parentElement; //클릭된 element의 부모 여기선 li를 가리킴. li.remove(); } function paintTodo(newTodo){ const li = document.createEleme..

00:00:00 quotes.js (명언랜덤) const quotes = [ { quote : "명언1", author : "넹1" }, { quote : "명언2", author : "넹2" }, { quote : "명언3", author : "넹3" }, { quote : "명언4", author : "넹4" }, { quote : "명언5", author : "넹5" }, { quote : "명언6", author : "넹6" }, { quote : "명언7", author : "넹7" }, { quote : "명언8", author : "넹8" }, { quote : "명언9", author : "넹9" }, { quote : "명언10", author : "넹10" }, ] const quote..

setInterval interval은 '매번' 일어나는 무언가를 말함 매 2초마다 무슨일이 일어나게 하고 싶을때 사용하는게 interval 함수 setInterval()은 2개의 argument를 받는다. 첫번째 argument는 내가 실행하고자 하는 function 두번재 argument는 호출되는 function 간격을 몇 ms(milliseconds)로 할지 결정하면 됨 setInterval(sayHello,5000) //sayHello함수가 5초마다 실행됨. setTimeout 만약 기다렸다가 실행하고 싶으면? setTimeout()함수 이용 setTimeout(sayHello, 5000); //sayHello함수가 5초후에 실행됨 padStart string에 쓸 수 있는 function 함수..
바뀌는값 const h1 = document.querySelector("div.hello:first-child h1"); function handleTitleClick(){ const clickedClass = "active"; if(h1.classList.contains(clickedClass)){ h1.classList.remove(clickedClass); } else { h1.classList.add(clickedClass); } } h1.addEventListener("click",handleTitleClick); const h1 = document.querySelector("div.hello:first-child h1"); function handleTitleClick(){ h1.classLi..
const h1 = document.querySelector("div.hello:first-child h1"); function handleTitleClick(){ const currentColor = h1.style.color; //getter개념 -변수가 가지는 의미에 따라서 나눠서 선언 let newColor; //setter개념 -변수가 가지는 의미에 따라서 나눠서 선언 if(currentColor === "blue"){ newColor = "tomato"; }else{ newColor = "blue"; } h1.style.color = newColor; } h1.addEventListener("click",handleTitleClick);

제목 : 카테고리 : 가격 : 내용 : 책표지 : //이미지를 넣을 공간 책표지 : //이미지 업로드 INPUT태그 Array.prototype.slice.call(arguments) --> 자바스크립트 배열 객체 반환 - slice() 메서드는 어떤 배열의 begin 부터 end 까지(end 미포함)에 대한 얕은 복사본을 새로운 배열 객체로 반환합니다. 원본 배열은 바뀌지 않습니다. Array.prototype.slice.call()을 사용하면 배열로 바뀌게 됩니다. * Array -> 배열을 생성할 때 사용하는 리스트 형태의 고수준 객체입니다. * Array.prototype -> Array객체의 메서드를 prototype을 통하여 가져옵니다. * Array.prototype.slice() -> be..

nav바 detail 쿼리문 SELECT A.EMP_NUM, A.EMP_ADDR, A.EMP_PHE, A.EMP_NM, A.EMP_PAY, A.EMP_MJ_NUM FROM EMP A WHERE A.EMP_NUM = 'EMP005' --본인 OR A.EMP_NUM = ( SELECT B.EMP_MJ_NUM FROM EMP B WHERE B.EMP_NUM = 'EMP005' --매니저찾기 ); nav바 직원 관리자 스크립트 $(".nav-link").on('click',function(){ //toggleClass()메서드는 해당 클래스를 토글함 $(".link").toggleClass("active"); //removeAttr() : 선택한 ㅇ요송에서 하나 이상의 특성을 제거함 $(".link").remo..

매니저명 검색 모달창 Modal title # 직원번호 이름 1 Mark Otto Close Save changes 스크립트(제이쿼리) //매니저선택하기 //모든직원가져오기 $('#btnEmpMjNum').on('click',function(){ $.ajax({ url : "/emp/getEmpAll", type : "post", success:function(result){ //result : List let code =""; $.each(result,function(index,empVO){ console.log('empVO.empNum:'+empVO.empNum); console.log('empVO.empNm:'+empVO.empNm); code += ""+(index+1)+""; code += ""..

/* 경로패턴매핑 * 요청경로를 동적으로 표현이 가능한 경로 패턴을 지정할 수 있음. * - URL 경로 상의 변하는 값을 경로변수(PathVariable)로 취급함. * - 경로변수에 해당하는 값을 파라미터 변수(매개변수-파라미터를 받아 값을 저장한느 변수)에 설정 할 수 있음. */ //요청URI : /board/100 => 100은 boardNo(게시판 기본키) //요청방식 : get @PostMapping("/board/{boardNo}") public ResponseEntity read(@PathVariable("boardNo")int boardNo){ log.info("boardNo :"+boardNo); ResponseEntity entity = new ResponseEntity("SUCCE..