


Detailed arrangement of javascript Window and document objects_Basic knowledge
--------------------------------------------- ------------- ------------------
Object properties
window //Window itself
window. self //Reference this window window=window.self
window.name //Name the window
window.defaultStatus //Set the window status bar information
window.location //URL address, configure this Properties can open a new page
---------------------------------------- ---------- -------------------
Object method
window.alert("text") //Prompt message dialog box
window.confirm("text") //Confirm dialog box
window.prompt("text") //Require keyboard input dialog box
window.setIntervel("action",time) //Every Execute an operation every specified time (milliseconds)
window.clearInterval() //The function of clearing the time configuration is to terminate the cycle
Window.setTimeout(action, time) //After the specified time (milliseconds) )Perform an operation
window.open() //Open a new window
window.close() //Close the window
----------------- ---------------------------------- ------------------ --
Member object
window.event
window.document //See document object for details
window.history
window.screen
window.navigator
window.external
------------------------------------------------ -------------------
window.history object
window.history.length //Number of pages viewed
history.back( ) //Retreat
history.forward() //Progress
history.go(i) //Forward or go back to the i-th page of the history
//i>0 progress, i ------------------------------------------------ ------- -------------------
window.screen object
window.screen.width //Screen width
window. screen.height //Screen height
window.screen.colorDepth //Screen color depth
window.screen.availWidth //Available width
window.screen.availHeight //Available height (excluding the height of the taskbar )
------------------------------------------------ ---- -------------------
window.external object
window.external.AddFavorite("Address", "Title" ) // Add website to favorites
---------------------------------------- ---------- -------------------
window.navigator object
window.navigator.appCodeName //Browser code name
window.navigator.appName //Browser program name
window.navigator.appMinorVersion //Browser patch version
window.navigator.cpuClass //cpu type x86
window.navigator.platform / /Operating system type win32
window.navigator.plugins
window.navigator.opsProfile
window.navigator.userProfile
window.navigator.systemLanguage //Customer system language zh-cn simplified Chinese
window.navigator.userLanguage //User language, same as above
window.navigator.appVersion //Browser version (including system version)
window.navigator.userAgent
window.navigator.onLine //Is the user online?
window.navigator.cookieEnabled //Whether the browser supports cookies
window.navigator.mimeTypes
======================== ==========================
2. Document object
객체 속성:
document.title //HTML
document.bgColor //페이지 배경색 설정
document.fgColor //전경 설정 color ( 텍스트 색상)
document.linkColor //클릭하지 않은 링크 색상
document.alinkColor //활성 링크 색상(포커스는 이 링크에 있음)
document.vlinkColor //색상 클릭한 링크
document.URL //같은 창에서 다른 웹페이지를 열도록 URL 속성 설정
document.fileCreatedDate //파일 생성 날짜, 읽기 전용 속성
document.fileModifiedDate //파일 수정됨 날짜, 읽기 전용 속성
document.fileSize //파일 크기, 읽기 전용 속성
document.cookie //쿠키 설정 및 읽기
document.charset //문자 집합 설정 중국어 간체: gb2312
------ ----------
일반적인 객체 메서드
document.write() //동적으로 페이지에 콘텐츠 쓰기
document.createElement(Tag) //html 태그 객체 생성
document.getElementById(ID) //지정된 ID 값을 가진 객체 가져오기
document.getElementsByName( Name) //지정된 Name 값을 가진 객체를 가져옵니다.
document.body.appendChild(oTag)
body-body sub-object
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.
동시에 해당 페이지에

--- ------- 표시합니다. -----
샘플 코드(동적 이미지 생성):


Both Python and JavaScript's choices in development environments are important. 1) Python's development environment includes PyCharm, JupyterNotebook and Anaconda, which are suitable for data science and rapid prototyping. 2) The development environment of JavaScript includes Node.js, VSCode and Webpack, which are suitable for front-end and back-end development. Choosing the right tools according to project needs can improve development efficiency and project success rate.

Yes, the engine core of JavaScript is written in C. 1) The C language provides efficient performance and underlying control, which is suitable for the development of JavaScript engine. 2) Taking the V8 engine as an example, its core is written in C, combining the efficiency and object-oriented characteristics of C. 3) The working principle of the JavaScript engine includes parsing, compiling and execution, and the C language plays a key role in these processes.

JavaScript is at the heart of modern websites because it enhances the interactivity and dynamicity of web pages. 1) It allows to change content without refreshing the page, 2) manipulate web pages through DOMAPI, 3) support complex interactive effects such as animation and drag-and-drop, 4) optimize performance and best practices to improve user experience.

C and JavaScript achieve interoperability through WebAssembly. 1) C code is compiled into WebAssembly module and introduced into JavaScript environment to enhance computing power. 2) In game development, C handles physics engines and graphics rendering, and JavaScript is responsible for game logic and user interface.

JavaScript is widely used in websites, mobile applications, desktop applications and server-side programming. 1) In website development, JavaScript operates DOM together with HTML and CSS to achieve dynamic effects and supports frameworks such as jQuery and React. 2) Through ReactNative and Ionic, JavaScript is used to develop cross-platform mobile applications. 3) The Electron framework enables JavaScript to build desktop applications. 4) Node.js allows JavaScript to run on the server side and supports high concurrent requests.

Python is more suitable for data science and automation, while JavaScript is more suitable for front-end and full-stack development. 1. Python performs well in data science and machine learning, using libraries such as NumPy and Pandas for data processing and modeling. 2. Python is concise and efficient in automation and scripting. 3. JavaScript is indispensable in front-end development and is used to build dynamic web pages and single-page applications. 4. JavaScript plays a role in back-end development through Node.js and supports full-stack development.

C and C play a vital role in the JavaScript engine, mainly used to implement interpreters and JIT compilers. 1) C is used to parse JavaScript source code and generate an abstract syntax tree. 2) C is responsible for generating and executing bytecode. 3) C implements the JIT compiler, optimizes and compiles hot-spot code at runtime, and significantly improves the execution efficiency of JavaScript.

JavaScript's application in the real world includes front-end and back-end development. 1) Display front-end applications by building a TODO list application, involving DOM operations and event processing. 2) Build RESTfulAPI through Node.js and Express to demonstrate back-end applications.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 English version
Recommended: Win version, supports code prompts!
