jQuery 다운로드 & CDN 방식 적용

 

 jQuery 다운로드

 

* jQuery 다운로드 방식

https://jquery.com/download/

 

Download jQuery | jQuery

link Downloading jQuery Compressed and uncompressed copies of jQuery files are available. The uncompressed file is best used during development or debugging; the compressed file saves bandwidth and improves performance in production. You can also download

jquery.com

 

1. jQuery 사이트 접속 → Download → Download the compressed, production jQuery 3.6.0 &

Download the uncompressed, development jQuery 3.6.0 마우스 우클릭하여 다른 이름으로 링크 저장

2. Eclipse에서 생성한 프로젝트 - WebContent - jQuery 작업할 경로에 복사

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="jquery-3.6.0.min.js"></script> <!-- jQuery 다운 받음 -->
<script type="text/javascript">

	// jQuery Code 작업
	console.log($(document));

</script>
</head>
<body>
</body>
</html>

 

 CDN 방식 - Google

https://developers.google.com/speed/libraries#jquery

 

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js">
</script><!-- CDN 방식 -->
<script type="text/javascript">

	// jQuery Code 작업
	console.log($(document));

</script>
</head>
<body>
</body>
</html>

 

 출처

 

 

+ 강의 교재

+ Recent posts