当前位置:网站首页>9. BOM object?
9. BOM object?
2022-07-24 18:21:00 【yingxingyf】
BOM yes browser object model Abbreviation , Browser object model for short .
adopt BOM We can learn some objects that interact with browser windows , Can be moved , Resizing the browser window object , It can be used
For navigation location Object and the history object , You can get the browser , Operating system and user screen information navigator And
screen object , have access to document As an interview HTML The entry to the document , Of the management framework frames Object etc. . So its core is It's like window.


1.Window Object properties
Window object : window Object represents an open window in the browser
Window Object properties :
Document object .
history object .
Location object
Screen object
name The name of the browser window
defaultStatus Sets or returns the default text in the window status bar .
status Set the text of the window status bar
2.location object
Location Object contains information about the current URL Information about .( Understanding can )
location Object properties
href attribute Control the contents of the browser address bar
hostname Set or return to current URL The host name .
location Object method
reload() Method Refresh the page
reload(true) Refresh the page , Do not use cache
3.history object
history Object contains user ( In the browser window ) Visited URL.( Understanding can )
attribute :
length Return to URL Number .
Method :
back() load history The previous one in the list URL.
forward() load history Next... In the list URL.
go() load history A specific page in the list , Or ask the browser to move to a specified number of pages ( Negative numbers are backward , just
Count forward )
4.navigator object
navigator Object contains information about the browser .( Understanding can )
appName Browser name
appVersion Browser version
platform operating system
notes : The latest browsers have completely abandoned these properties
userAgent User agent information , Through this attribute, you can obtain browser and operating system information
The demo part window Object properties
5.document object
Every browser loaded with HTML Documents will become Document object .
Document Object enables us to modify from script HTML All elements in the page are accessed
Document The object is Window Part of the object , It can be done by window.document Property to access it
Document Object properties
all[] Provides a description of all HTML Element access . It's an array type
forms[] Return to all of the Form Object reference . It's an array type
body Provide right Direct access to elements .
URL Returns the URL.
bgColor attribute : You can change the color of the document ;( document.bgColor=“gray”;)
Document Object function ( Method )
getElementById() Return to have specified id Reference to the first object of .
getElementsByName() Returns a collection of objects with the specified name .
getElementsByTagName() Returns a collection of objects with the specified tag name .
write() Write... To the document HTML expression or JavaScript Code .
6.Window Object method
alert(“”) Display a warning box with a message and a confirm button .
confirm(“”) Displays a dialog box with a message and a confirm and Cancel buttons .
prompt(“”) Displays a dialog box that prompts for user input .
open(“url”,”name”) Open a new browser window or find a named window .
showModalDialog (“ Open the window url”,” Window name ”,” Window features ”)(chrome I won't support it )
close() Close the browser window . ( FF I won't support it )
focus () The window loses focus
setInterval() According to the specified period ( In milliseconds ) To call a function or evaluate an expression .
clearInterval() Cancel from setInterval() Set up timeout.
setTimeout() Call the function or computing expression after the specified millisecond count. .
clearTimeout() Cancel from setTimeout() Method set timeout.
moveBy() Moves the window to the specified pixel relative to its current coordinates .
moveTo() Move the upper left corner of the window to a specified coordinate .
resizeBy() Resize the window to the specified pixel .
resizeTo() Resize the window to the specified width and height .
scrollBy() Scrolls content according to the specified pixel value .
scrollTo() Scroll content to specified coordinates .
边栏推荐
- [opencv] - thresholding
- Array object methods commonly used traversal methods & higher-order functions
- Space three point circle code
- 数组常用方法(2)
- 0621~ES&Lucene
- Show or hide password plaintext + password box verification information
- 缺失值处理
- Several sorting methods for while and sort
- Go language file operation
- 手写博客平台~第二天
猜你喜欢

Three ways of redis cluster

Sword finger offer 21. adjust the array order so that odd numbers precede even numbers

The drop-down list component uses iscrol JS to achieve the rolling effect of the pit encountered

Install jumpserver

Maximum sum and promotion of continuous subarrays (2)

手写博客平台~第二天

关于接口的写法 1链式判读 ?. 2方法执行 (finally)一定会执行

Flink operation Hudi data table

继承与派生

Inheritance and Derive
随机推荐
Escape character in JS?
【刷题记录】20. 有效的括号
Introduction and use of Pinia
[opencv] - thresholding
Use of jumpserver
Go to bed capacity exchange
Mozilla foundation released 2022 Internet health report: AI will contribute 15.7 trillion yuan to the global economy in 2030, and the investment in AI in the United States last year was nearly three t
New can also create objects. Why do you need factory mode?
PXE efficient batch network installation
Laravel notes - RSA encryption of user login password (improve system security)
0623~ holiday self study
The collapse of margin
JS to achieve progress steps (small exercise)
Three ways of redis cluster
Int8 & int8, have you ever stumbled like this?
Mac database management software Navicat premium essentials mac
IO multiplexing
模拟实现vector
Space three point circle code
球面上绘制圆matlab仿真