jQeury

jQuery 파일 링크하기

밍블리-셔 2022. 5. 12. 17:42
  • 링크연결

   http://code.jquery.com/jquery-latest.js

 --> jQuery의 가장 최신버전을 연결 (CDN) / 인터넷 연결시에만 가능

 

 

 

  • 다운로드 받아서 연결

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

위 링크에서 가장 최신버전을 다운로드 한 뒤 script 폴더를 생성해 안에 넣어주고 html문서에서 링크를 걸어서 사용

* js오픈소스 파일을 직접 만드는 custom.js 파일보다 위에 위치시켜야한다. 꼭!!!

 

<body>에 링크하기

- </body>바로 위에 링크

 

 

<head>에 링크하기

- </head>바로 위에 링크

 

보통 <head>에 많이 위치시킨다고 하는데 그렇게 되면

$(function(){

~~~~~~~~~~

})

이라는 계층구조가 하나 더 늘어나게 되서

공부할때에는 <body>안에 위치시켜서 쓰려고 한다.