当前位置:网站首页>BOM browser object model
BOM browser object model
2022-07-23 05:14:00 【m0_ sixty-two million one hundred and sixty-eight thousand and 】
BOM:Browser Object Model( Browser object model )
Provides objects that interact with browser windows independently of content
Object name explain
window Window object , It can be used to control the current window , Or open a new window
screen Screen objects , Get screen related information

navigator Browser object , This object can be used to determine the browser used by the user


history Historical object , It can be used to move forward or backward a page , There must be one a link , To jump , Generate records
//history.forward(); history.go(1)// Browser forward ;
history.go(2)// Browser jumps to the third page , But the second page must jump to the third page and be effective only after it is recorded
//history.back();history.go(-1)// Browser back ;
//history.go(0)// Refresh the page ;

window.location object
Used to get the address of the current page (URL), And redirect the browser to a new page
grammar explain
location.href Return to... On the current page URL, Full address
location.href="./xxx.html", Quotation marks must be added
location.pathname return URL Pathname of
location.assign Load new document , Jump
location.assign(“./xxx.html ”)
location.hosthost Address ( Include domain name ( only one ) And port ( Can be more ))
location.hostname domain name
location.origin source address : Include ( agreement :http:// perhaps https:// encryption )、 Domain name and port
location. prort port
location.protocol agreement :http:// perhaps https:// encryption
location.hash Get hash address Anchor link address name
location. search Search data , Get string type
notes : A general anchor address is placed behind the search data
location.reload Reload And history.go(0) The function of refreshing the page is the same
location.replace Replace the current page , No history will be generated

JavaScript Timing events
grammar explain
setInterval() Executes the specified code continuously for the specified number of milliseconds in the interval
clearInterval() Used to stop setInterval() Function code executed by method
setTimeout() Pauses for the specified number of milliseconds before executing the specified code
clearTimeout() Used to stop execution setTimeout() Method
setInterval() Method Timer , Call a function repeatedly , There is a fixed time interval between each call
setInterval(" Called function ", The number of milliseconds between )
// setInterval After execution, a unique Id,Id Is the key to clearing the timer
clearInterval() Method Clear the timer
Clear the timer
clearInterval(setInterval() Back to ID value )
for example :

setTimeout() Method Time delayer , When the appointed time comes , Will execute the function once , No more repetition
setTimeout(" Called function ", The number of milliseconds to wait )
example :
3 second (3000 millisecond ) Then execute the function a() once
a=setTimeout(function(){
//do something
},3000)
clearTimeout() Method Clear the delayer
clearTimeout(setTimeOut() Back to ID value )
clearTimeout() Method can be cancelled by setTimeout() Method execution

setInterval() And setTimeout、clearInterval()、clearTimeout() All belong to window Object
setInterval() And setTimeout Features and differences :
characteristic
setInterval() and setTimeout() Used to handle delayed and scheduled tasks ,
difference
setTimeout() Method is used to call functions or compute expressions after specified milliseconds. , and setInterval() You can call a function or expression every specified number of milliseconds
practice 1: Real time computing from now to 2022 year 7 month 1 Countdown to the Japanese army day , The format is... Before the army day :xx God xx Hours xx minute xx second , And in a second , Print on the page once , After a second , Print on the page once .

localStorage
localStorage Permanent storage , Even if the browser closes the page , Data is still stored locally , Unless you clear it yourself
// * As long as the domain name and port are consistent , Although the path names are different , But the data still exists

边栏推荐
- GIC Introduction (III) -- gic400 register
- After wechat V2 2.1.8, the distribution settings cannot be saved. Solution: wechat engine
- 【转载】CentOS 7 安装 mysql + mysql 常用命令 + docker 运行 mysql
- Sort out the details of relative position bias and droppath in transformer
- *编码理解*Pytorch中常见的函数解析
- 架构训练营模块一作业
- 项目实战-文档扫描OCR识别
- Redis script scan
- Waffle Nano初相识
- Druid源码阅读2-DruidDataSource的init过程
猜你喜欢

数字孪生示范项目——从单摆谈起(3)实体模型探索

Learn about arXiv and the registration details of arXiv.

GIC 介绍 (二)—gic400 使用

*Thesis *emoticon: context aware multimodal emotion recognition using Frege's principle thesis translation

图像特征-harris-角点检测

LVGL:模拟器仿真

3步就能制作漫画头像的机器人,想拥有一个吗?

Introduction to basic knowledge of GIC (I)

*Thesis * understanding of attention mechanism se thesis

DOM—节点操作
随机推荐
Bert-mrc paper notes
智能机器人与智能系统(大连理工大学庄严教授)——3.工业机器人
51nod 2664 alphabet (DAG)
Druid源码阅读6-PreparedStatementPool源码及使用场景分析
After wechat V2 2.1.8, the distribution settings cannot be saved. Solution: wechat engine
Emotional tendency calculation based on Baidu AI Cloud platform
Druid源码阅读9-DruidDataSource和DruidConnection中的状态
AXI协议详解
Verilog design related (continuous update)
uniapp项目打包为桌面应用的方法步骤
P5905 [template] Johnson full source shortest circuit
WPS mathtype安装 错误53
SVM To Face Recognize
Espressif 玩转 WebSocket
jena-fuseki 在线更新数据库
Jetpack - mediatorlivedata of livedata extension
C 语言基础知识梳理
Druid源码阅读10-DruidDataSource中的一些计数器
pycharm汉化之后切换回英文
ZO1X(功能安全验证)介绍