BackEnd/JSP
[JSP] jQuery 사용하기
best
2016. 3. 7. 10:23
1. http://jquery.com/ 에 접속하여 Download jQuery를 선택한다.
2. Download the uncompressed, development jQuery 1.12.1 을 선택하여 다운로드
3. 다운로드한 jquery를 프로젝트안에 있는 WebContent에 폴더를 생성하여 넣어준다.
4. jsp에서 jquery를 사용하기 위해서는 <head> 안에 아래와 같은 스크립트 type을 작성한다.
<script type="text/javascript" src="<c:url value="/resource/js/jquery-1.12.1.js"/>"></script>
<script type="text/javascript">
webContent안에 resource 폴더를 만들고 js폴더에 넣어주었으므로 경로 설정을 /resource/js/jquery-1.12.1.js 로 했다.