자바 &제이쿼리 - 제이쿼리 의미와 쓰임

2020. 8. 3. 10:08학원공부/javascript &jquery

jQuery  개발 환경 설정

jQuery 라이브러리 삽입

 

방법 1. CDN ( Content Delivery ) 

 

 

 

진입점 ready() 메소드 설정

java의 main() 메소드에 해당

문서의 노드를 사용할 준비가 되면 Document 객체에서 발생하는 DOMContentLoaded 이벤트 처리를 포장한 메소드

 

 

jqueyr 사이트 :  https://api.jquery.com/jquery/

 

jQuery() | jQuery API Documentation

Description: Creates DOM elements on the fly from the provided string of raw HTML. Creating New Elements If a string is passed as the parameter to $(), jQuery examines the string to see if it looks like HTML (i.e., it starts with ). If not, the string is i

api.jquery.com

 

 

 

 

jQuery( selector [, context ] )

 

$( document).ready(function() {

alert 안녕하세요 . jQuery 에 오신 걸 환영합니다
});

 

내 브라우저 나타난 상태가 ".ready"   

 

 

1.

html 이 다 준비 (.ready) 되면 (function {})을 실행해라

 

 

window.onload = function() 을 사용하게 되면 먼저 실행 완료된게 페이지에 뜨게됨

예) 사이트 접속했는데 글들이 먼저 뜨고 이미지가 나중에 뜨는 것.

 

 

 

 

 

$는 jquery의 단축이다.

 

$( 안에 들어가있는 것은 jQuery인 리턴값이 된다)

 

 

 

<div>태그 4개가 묶여서 css함수가 생성되어 해당 스타일을 적용 받는다

 

 

'학원공부 > javascript &jquery' 카테고리의 다른 글

제이쿼리 - 노드찾기  (0) 2020.08.03