Presentation is loading. Please wait.

Presentation is loading. Please wait.

JavaScript 객체 peridot@suned.co.kr 전 혜 영.

Similar presentations


Presentation on theme: "JavaScript 객체 peridot@suned.co.kr 전 혜 영."— Presentation transcript:

1 JavaScript 객체 전 혜 영

2 객체 객체 객체의 종류 모든 사물을 바탕으로 프로그램 설계기법 단. 프로그램 할 범주 내에서 객체 선정 사용자 정의 객체
JavaScript 내장 객체 Web Browser 내장 객체

3 자바 스크립트 내장 객체 자바 스크립트 내장 객체 정의
문자열, 배열, 수학적 상수들과 같은 근본적 타입과 날짜 객체와 같은 미리 정의된 객체 스크립트의 향상된 작업 지원 정의없이 선언만 하면 객체 사용 가능 Date String Math Arrary

4 브라우저 객체 브라우저에 종속된 객체 window : 자바스크립트 객체 계층의 최상위 레벨.
document : 현재 HTML문서에 반영되어 있는 속성들을 가짐. location : 현재 문서의 위치와 관련된 속성들 (예를들면, URL) history : 브라우저의 세션에서 사용자가 검색한 모든 URL항목들이 있음. navigator : 브라우저에대한 자세한 정보들이 있음.

5 웹 브라우저 내장 객체 계층구조 Navigator windows frame history document location
appName appVersion frame history document location link anchor layer form applet image area text radio button fileUpload select textarea checkbox reset option submit password

6 Navigator Object Navigator 객체 정의 Navigator 객체 속성 Navigator 객체 메소드
현재 웹브라우저에 관한 정보 제공 (NN 와 IE 체크) 독립적인 객체 Navigator 객체 속성 appName appVersion mimeTypes Plugins Navigator 객체 메소드 javaEnabled()

7 Window Object Window 객체 정의 브라우저 내장 객체중 최상위 객체
nabigator 객체를 제외한 모든 객체를 포함 하위 객체 선언시 Window 객체명은 생략가능 window.document.write(“안녕하세요”)  document.write(“안녕하세요”) 새로운 창을 열거나 윈도우의 속성을 설정할 때 사용

8 Window Object Window 객체의 속성 defaultStatus status self
innerHeight (body.clientHeight) innerWidth (body.clientWidth) pageXOffset (body.scrollLeft) pageYOffset (body.scrollTop) 단. ()은 IE전용

9 Window Object Window 객체의 메소드 resizeBy(a,b) alert() resizeTo(a,b)
moveBy(a,b) moveTo(a,b) scrollBy(a,b) scrollTo(a,b) Window 객체의 메소드 alert() Confirm() frompt() open() close() setTimeout(함수 또는 명령, 시간) clearTimeout() setInterval() clearInterval() print()

10 Window Object menubar toolbar location scrollbar status

11 Document Object Document 객체 정의 웹브라우저에 표시된 문서의 모든 정보를 관리
사용자에게 HTML 결과물에 대한 메소드 제공

12 Document Object Document 객체 속성 Document 객체 메소드
title lastModified bgColor fgColor linkColor alinkColor vlinkColor Document 객체 메소드 write() writeln() open() close() clear()

13 Location Object Location 객체 정의 현재 열려진 URL 주소에 관한 정보 제공
브라우저 상단에 있는 문서 위치 필드의 값 가진다. 브라우저의 프로토콜 종류, 호스트 이름, 포트번호, 디렉토리 위치 파일이름 등 정보 볼수 있다.

14 Location Object Location 객체 속성 Location 객체 메소드
href host hostname protocol pathname port hash search Location 객체 메소드 reload() replace() -NN전용

15 History Object History 객체 정의 History 객체 속성 History 객체 메소드
브라우저를 이용하여 본 url 사이트를 임시로 저장 history 객체를 통해서 다시 방문 History 객체 속성 history.length History 객체 메소드 go() back() forword()

16 Image Object Image 객체 정의 Image 객체 속성 이미지에 관한 정보에 접근하기 위해
border complete height width lowsrc name src vspace hspace handleEvent() NN전용

17 Form Object Form 객체 정의 HTML의 단점인 사용자와 상호 대화 기능 보완
form 태그를 이용해 구현 속성: name target action method onsubmit onreset


Download ppt "JavaScript 객체 peridot@suned.co.kr 전 혜 영."

Similar presentations


Ads by Google