개발 공부/js(4)
-
Uncaught TypeError:$ajax is not a function error
자바스프링 하다가 js와 연동할떄 있었다 계속 $ajax쪽에서 에러가 나길래 구글링해봤는데$.ajax를 사용하기위해서 slim제거해야지 오류가 해결된다 참고하자 //slim 제거하고사용하자 Neither of the answers here helped me. The problem was: I was using the slim build of jQuery, which had some things removed, ajax being one of them. https://stackoverflow.com/questions/18271251/typeerror-ajax-is-not-a-function TypeError: $.ajax(...) is not a function? I'm attempting to creat..
2023.02.21 -
about toggle and getElementById
const bttn = document.getElementById('bttn');//id속성있을때 사용한다 const nav = document.getElementById('nav'); bttn.addEventListener('click', () => { nav.classList.toggle('active');//toggle()토글이란 on/off의 개념으로 스위치를 켰다,껏다하는기능이 있다 bttn.classList.toggle('active'); }); https://developer.mozilla.org/ko/docs/Web/API/Document/getElementById Document.getElementById() - Web API | MDN Document.getElementById() 메서..
2023.02.09 -
js 비교 연산자
js 연산자 기능 사용예 == 피연산자 값이 같으면 true 3=="3" true === 피연산자값과 데이터 유형이 모두같으면 true a==="3" false != 피연산자값이 값지않으면 true 3!= "3"false !== 피연산자값과 데이터 유형이 모두 값지않으면 true 3!=="3" true 다른 언어엔 없고 자바스크랩트 에만있는 기능을 올려봤다
2023.02.07 -
javasrcipt 예약어 특징
예약어 선언 하지않고 사용할 경우 재선언 재할당 var 오류없음 (호이스팅 발생) O O let 오류발생 X O const 오류 발생 X X 웹개발 공부하다가 자바스크랩트를 공부안해서 변수 예약대한 정리 할필요있다고 생각해서 정리봅니다
2023.02.07