jQuery

RNR·2021년 10월 14일
0

jQuery 사용하는 법

jQuery CDN

태그 바로 윗 줄에 jQuery CDN의 코드를 붙여 넣는다.

링크의 버전을 복사-붙여넣기하면 된다.

<script
  src="https://code.jquery.com/jquery-3.2.1.min.js"
  integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
  crossorigin="anonymous"></script>
<script>
  // 우리 자바스크립트 코드...
</script>
  1. 직접 jQuery 코드를 다운로드
    코드를 다운로드 받아서 프로젝트 안의 어딘가에 두고,
<script src="js/jquery-3.2.1.min.js"></script>
<script>
// 우리 자바스크립트 코드...
</script>

장단점

속도 상에서는 CDN(1) 방식이 낫다. 하지만 이 CDN에 문제가 생기면 jQuery를 쓸 수 없다.

profile
개인적 공부 기록. 그때그때 메모합니다.

0개의 댓글

관련 채용 정보