>  기사  >  웹 프론트엔드  >  자바스크립트 창과 문서객체의 세부정렬_기본지식

자바스크립트 창과 문서객체의 세부정렬_기본지식

WBOY
WBOY원래의
2016-05-16 18:12:06957검색
1. 창 개체
 ------------------------- -------- ------------- -----  
 객체 속성
 창 // 창 자체
 window.self //이 창 참조 window=window.self
window.name //창 이름 지정
window.defaultStatus //창 상태 표시줄 정보 설정
window.location / /URL 주소, 이 속성을 구성하면 새 페이지를 열 수 있습니다
 ---------------------- ----- ---------- ------
 객체 메서드
 window.alert("text") //프롬프트 메시지 대화 상자
window.confirm("text") //확인 대화 상자
window.prompt("text") //키보드 입력 대화 상자 필요
window.setIntervel("action" ,time) //Every 지정된 시간(밀리초)마다 작업을 실행합니다.
window.clearInterval() //시간 구성을 지우는 기능은 주기를 종료하는 것입니다.
Window.setTimeout(action, time) // 지정된 시간(밀리초) 이후 )작업 수행
 window.open() //새 창 열기
 window.close() //창 닫기
 --------- -------- -------- -------- ---------- --
멤버 개체
window.event
window.document //자세한 내용은 문서 개체 참조
window.history
window.screen
window.navigator
window.external
------------------------- ----------- ------
 window.history 객체
 window.history.length //페이지 수 views
 history.back( ) //후퇴
history.forward() //진행
history.go(i) //히스토리 i번째 페이지로 앞으로 또는 뒤로 가기
//i>0 진행, i  ---------------------- ------------- ------- ------
window.screen 개체
창 .screen.width //화면 너비
window.screen.height //화면 높이
window.screen.colorDepth //화면 색상 깊이
window.screen.availWidth //사용 가능한 너비
window. screen.availHeight //사용 가능한 높이 (작업 표시줄 높이 제외)
 -------------------------------- --- ---- ------
window.external object
창 .external.AddFavorite("Address", "Title" ) // 즐겨찾기에 웹사이트 추가
 ---------------------------- ------------ ---------- ------
 window.navigator 개체
 window.navigator.appCodeName //브라우저 코드 이름
window.navigator.appName //브라우저 프로그램 이름
window.navigator.appMinorVersion //브라우저 패치 버전
window.navigator.cpuClass //cpu 유형 x86
window.navigator.platform / /운영 체제 유형 win32
window.navigator.plugins
window.navigator.opsProfile
window.navigator.userProfile
window.navigator.systemLanguage //고객 시스템 언어 zh-cn 중국어 간체
window.navigator.userLanguage //사용자 언어, 위와 동일
window.navigator.appVersion //브라우저 버전(시스템 버전 포함)
window.navigator.userAgent
window.navigator.onLine //사용자가 온라인 상태입니까?
window.navigator.cookieEnabled //브라우저가 쿠키를 지원하는지 여부
window.navigator.mimeTypes
=========== ============ =========================

2. 객체

객체 속성:
document.title //HTML 태그와 동일한 문서 제목 설정 <br>document.bgColor //페이지 배경색 설정 <br>document.fgColor //전경 설정 color ( 텍스트 색상) <br>document.linkColor //클릭하지 않은 링크 색상<br>document.alinkColor //활성 링크 색상(포커스는 이 링크에 있음)<br>document.vlinkColor //색상 클릭한 링크 <br>document.URL //같은 창에서 다른 웹페이지를 열도록 URL 속성 설정<br>document.fileCreatedDate //파일 생성 날짜, 읽기 전용 속성<br>document.fileModifiedDate //파일 수정됨 날짜, 읽기 전용 속성<br>document.fileSize //파일 크기, 읽기 전용 속성<br>document.cookie //쿠키 설정 및 읽기 <br>document.charset //문자 집합 설정 중국어 간체: gb2312 <br>------ ---------- <br><br>일반적인 객체 메서드<br><br>document.write() //동적으로 페이지에 콘텐츠 쓰기 <br>document.createElement(Tag) //html 태그 객체 생성<br>document.getElementById(ID) //지정된 ID 값을 가진 객체 가져오기<br>document.getElementsByName( Name) //지정된 Name 값을 가진 객체를 가져옵니다. <br>document.body.appendChild(oTag) <br><br>body-body sub-object<br><br>document.body //시작 및 문서 본문의 끝은
document.body.bgColor //객체 뒤의 배경색을 설정하거나 가져옵니다
document.body.link //클릭하지 않은 링크의 색상
document.body.alink //링크 활성화(초점이 이 링크에 있음) 위)
document.body.vlink //클릭한 링크의 색상
document.body.text //텍스트 색상
document.body .innerText //설정...
document.body.innerHTML 사이의 텍스트 //...
document.body.topMargin 사이의 HTML 코드 설정 / /페이지 상단 여백
document.body .leftMargin //페이지 왼쪽 여백
document.body.rightMargin //페이지 오른쪽 여백
document.body.bottomMargin //페이지 하단 여백 페이지
document.body.ground //배경 이미지
document.body.appendChild(oTag) //동적으로 HTML 객체 생성
공통 객체 이벤트

document.body.onclick= "func()" //마우스 포인터로 객체를 클릭하면 트리거됩니다
document.body.onmouseover="func()" //마우스 포인터가 객체로 이동할 때 트리거됩니다
document.body.onmouseout= "func()" //마우스 포인터가 객체 밖으로 이동할 때 트리거
location-location 하위 객체
document.location.hash // #
document.location.host 다음 부분 // 도메인 이름 포트 번호
document.location.hostname // 도메인 이름
document.location.href // 전체 URL
document.location.pathname // 디렉토리 부분
document.location.port // 포트 번호
document.location.protocol // 네트워크 프로토콜(http:)
document.location.search // ? 숫자 뒤의 부분

공통 개체 이벤트
documeny.location. reload() //웹페이지 새로고침
document.location.reload(URL) //새 웹페이지 열기
document.location .sign(URL) //새 웹페이지 열기
document. location.replace(URL) //새 웹페이지 열기
=================================== ======================================
선택-선택 하위 개체
문서.선택
=========================================== =============================
이미지 컬렉션(페이지 이미지 내):
------ ----------------------
a) 컬렉션을 통해
document.images 참조 //페이지의 해당 자바스크립트 창과 문서객체의 세부정렬_기본지식 태그
document.images.length //해당 페이지의 자바스크립트 창과 문서객체의 세부정렬_기본지식 태그 개수
document.images[0] //첫 번째 자바스크립트 창과 문서객체의 세부정렬_기본지식 태그
document.images[i] //i-1th 자바스크립트 창과 문서객체의 세부정렬_기본지식 태그
-------------------------------
b)
직접 참조자바스크립트 창과 문서객체의 세부정렬_기본지식
document.images.oImage //document.images.name 속성
--- nane 속성을 통해 ----------- -
c) 이미지의 src 속성 참조
document.images.oImage.src //document.images.name attribute.src
------ --------- --------------
d) 이미지 생성
var oImage
oImage = new Image()
document .images.oImage.src="1. jpg"
동시에 해당 페이지에 자바스크립트 창과 문서객체의 세부정렬_기본지식 태그를 생성하여
--- ------- 표시합니다. -----
샘플 코드(동적 이미지 생성):

자바스크립트 창과 문서객체의 세부정렬_기본지식




성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.