当前位置:网站首页>BOM document
BOM document
2022-06-26 05:34:00 【The simplicity of programmers】
1.BOM The concept of
BOM(Browser Object Model) The browser object model , The browser object model provides content independent 、 Object structure that can interact with browser windows .BOM Composed of multiple objects , Which represents the browser window Window The object is BOM The top object of , Other objects are children of the object .
2.BOM The top object of window, When calling window Properties and methods under can be omitted window.
3. Page load event
onload attribute
window.onload = function () {
// When the page is loaded, execute
// When the page is fully loaded ( Include images 、 Script files 、CSS Documents, etc. ) perform
}
onunload attribute
window.onunload = function () {
// Execute... When the user exits the page
}
4. Timer
setTimeout() and clearTimeout()
Executes the specified function after the specified number of milliseconds , Only once .
// Create a timer ,1000 In milliseconds, execute , Return to the mark of the timer
var timerId = setTimeout(function () {
console.log('Hello World');
}, 1000);
// Cancel the timer
clearTimeout(timerId);
setInterval() and clearInterval()
Functions that are called regularly , At a given time ( Unit millisecond ) Call the function periodically
// Create a timer , every other 1 One call per second
var timerId = setInterval(function () {
var date = new Date();
console.log(date.toLocaleTimeString());
}, 1000);
// Cancel the timer
clearInterval(timerId);
5.location object
location The object is window Object , Time can be omitted window object
location Can get or set the browser address bar URL
6.URL
Uniform resource locator (Uniform Resource Locator, URL)
URL The composition of
scheme://host:port/path?query#fragment
scheme: Communication protocol
frequently-used http,ftp,maito etc.
host: host
The server ( Computer ) The domain name system (DNS) Host name or IP Address .
port: Port number
Integers , Optional , Use the default port of the scheme when omitted , Such as http The default port is 80.
path: route
By zero or more '/' String separated by symbols , Generally used to represent a directory or file address on the host .
query: Inquire about
Optional , Used to pass parameters to dynamic web pages , There can be multiple parameters , use '&' Symbols separate , The name and value of each parameter are '=' Symbols separate . for example :name=zs
fragment: Pieces of information
character string , Anchor point .
location Who are the members ?
Use chrome The console view
assign()/reload()/replace()
hash/host/hostname/search/href……
7.history object
back()
forward()
go()
8.navigator object
userAgent
adopt userAgent You can determine the type of user's browser
platform
adopt platform You can judge the system platform type of the browser
边栏推荐
- 一段不离不弃的爱情
- 【上采样方式-OpenCV插值】
- [upsampling method opencv interpolation]
- PHP 2D / multidimensional arrays are sorted in ascending and descending order according to the specified key values
- Installation and deployment of alluxio
- 无线网络存在的安全问题及现代化解决方案
- [MySQL] MySQL million level data paging query method and its optimization
- uni-app吸顶固定样式
- 第九章 设置结构化日志记录(一)
- Data storage: the difference between MySQL InnoDB and MyISAM
猜你喜欢
Setting pseudo static under fastadmin Apache
Wechat team sharing: technical decryption behind wechat's 100 million daily real-time audio and video chats
redis探索之布隆过滤器
Tp5.0 framework PDO connection MySQL error: too many connections solution
As promised: Mars, the mobile terminal IM network layer cross platform component library used by wechat, has been officially open source
The State Council issued a document to improve the application of identity authentication and electronic seals, and strengthen the construction of Digital Government
cartographer_optimization_problem_2d
【上采样方式-OpenCV插值】
Replacing domestic image sources in openwrt for soft routing (take Alibaba cloud as an example)
AutowiredAnnotationBeanPostProcessor什么时候被实例化的?
随机推荐
DOM文档
Leetcode513.找出树的左下角的值
国务院发文,完善身份认证、电子印章等应用,加强数字政府建设
Something about MariaDB
Consul服务注册与发现
[MySQL] MySQL million level data paging query method and its optimization
Redis discovery bloom filter
使用Jedis监听Redis Stream 实现消息队列功能
第九章 设置结构化日志记录(一)
Chapter 9 setting up structured logging (I)
Talk 5 wireless communication
The most refined language interprets the event dispatcher (also known as the event scheduler)
项目中止
A love that never leaves
转帖——不要迷失在技术的海洋中
How to ensure the efficiency and real-time of pushing large-scale group messages in mobile IM?
ZigBee learning in simple terms Lecture 1
定位设置水平,垂直居中(多种方法)
【MYSQL】MySQL 百万级数据量分页查询方法及其优化
About XXX management system (version C)