当前位置:网站首页>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 .
边栏推荐
- redis集群的三种方式
- undefined reference to H5PTopen
- 0627~ holiday knowledge summary
- Common methods of array (2)
- 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
- mysql 配置文件
- 开窗函数(1)-部门工资前三员工
- Pytoch's journey 1: linear model
- Typora 它依然是我心中的YYDS 最优美也是颜值最高的文档编辑神器 相信你永远不会抛弃它
- Admin component
猜你喜欢

Typora 它依然是我心中的YYDS 最优美也是颜值最高的文档编辑神器 相信你永远不会抛弃它

Pycharm configuring opencv Library

Wechat applet

Use of jumpserver

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

【obs】依赖库: x264 vs 构建

【刷题记录】20. 有效的括号

["code" power is fully open, and "chapter" shows strength] list of contributors to the task challenge in the first quarter of 2022

根证书的有效期与服务器SSL证书一样长吗?

6126. Design food scoring system
随机推荐
JMeter -- prometheus+grafana server performance visualization
File upload vulnerability -.User.ini and.Htaccess
A practical scheme of realizing 0.5px on mobile terminal
树链剖分板子
Highcharts chart and report display, export data
Has polardb for PostgreSQL entered the list of Xinchuang database?
Encapsulate function basedata.js
Emerging potential of interactive virtual reality technology in drug discovery
关于接口的写法 1链式判读 ?. 2方法执行 (finally)一定会执行
Problems needing attention in writing pages
How to prepare for hyperinflation
Matlab simulation of drawing circle on sphere
Web penetration experience summary ing
数组常用方法(2)
13 essential methods of color!
[verification] only numbers (positive and negative numbers) can be entered
New can also create objects. Why do you need factory mode?
Handwritten blog platform ~ the next day
Pycharm configuring opencv Library
【obs】依赖库: x264 vs 构建