当前位置:网站首页>BOM in JS
BOM in JS
2022-06-28 16:53:00 【Antenna frame】
We are JavaScript In this blog JavaScript There are three parts :
ECMAScript standard ( Basic grammar )
DOM:Document Object Model Document object model , Manipulating page elements
BOM:Browser Object Model Browser object model , Operating the browser
BOM It's the browser object model
BOM It provides some object interfaces that interact with browser windows independently of content pages
BOM The core is window object , therefore window Generally, it can be omitted in writing .
BOM In fact, it is also composed of a series of related objects , And each object provides a lot of methods and properties
BOM Top level objects in
window Object is the top-level object of the browser , Have a dual role
window The object is JS An interface for accessing browser windows
window Object is a global object , All global variables declared , Global method functions end up being window Property or method of the object
other window Method
window object effect
window.open() Open a new window
window.close() Close the current window
window.moveTo() Move the current window
window.resizeTo() Adjust the size of the current window
JavaScript Window Screen
Screen object effect
screen.availWidth Available screen width
screen.availHeight Available screen height
JavaScript Window Location
Location object effect
location.href Return to... On the current page URL
location.hostname return web Domain name of the host
location.pathname Returns the path and filename of the current page
location.port return web Host port (80 or 443)
location.protocol Return to used web agreement (http:// or https://)
location.hash Return fragment ,URL in # Later
location.search Returns the parameter ,URL Parameters refer to URL After the URL in the address ? Later parameters
location.assign() and href equally , You can jump to the page , Redirect jump
location.replace() Replace the current page , Not recorded in history , So you can't go back to the page
location.reload() Reload the page , Equivalent to the refresh button , If the parameter is true It is equivalent to forced refresh
JavaScript Window History
window Object provides a for browsers history Object to interact with the browser's history , In order to protect the privacy of users , Yes JavaScript Access to the object is restricted .
History object effect
history.back() Same as clicking the back button in the browser
history.forward() It's the same as clicking the button in the browser to move forward
history.go( Parameters ) Forward and backward function , If the parameter is 1 Go to a page , If it is -1 Back one page , If it is N Forward or backward N A page
JavaScript Window Navigator
Navigator Object is mainly used to record information about the browser .
Navigator object effect
window.navigator.userAgent adopt userAgent You can determine the type of user's browser
window.navigator.platform adopt platform You can judge the system platform type of the browser
边栏推荐
- PotPlayer播放百度云盘视频
- 通过setTimeout解决子组件不会销毁的问题
- The first place on the list - brake by wire "new cycle", the market competitiveness of local suppliers is TOP10
- 【杂谈】2021/01/31 哦豁
- 如何让你的 WordPress 网站更安全
- How to clear the cache in WordPress
- 【208】基于AccessToken方式实现API设计
- 从入门到精通|Yalmip+Cplex在电力系统中的应用(超棒,看不懂算我输,没有收获也算我输)
- offsetwidth\clientwidth\scrollwidth
- 【TcaplusDB知识库】查看业务密码
猜你喜欢

You have a chance to collect wool. Click "earn" and you will have a chance to earn a high commission

AI落地的新范式,就“藏”在下一场软件基础设施的重大升级里

Use open connector to integrate hubspot and SAP systems

Cardinality sorting - common sorting method (2/8)

Super automation and the future of network security

ICML 2022 | 基于解耦梯度优化的可迁移模仿学习方法

10.hystrix circuit breaker

Cloud sports, 360 ° witnessing speed and passion

General solution of island problems and DFS framework

On the design principle of price discount in SAP software
随机推荐
10.Hystrix断路器
Convolutional neural networks for machine learning -- an introduction to CNN
【尚硅谷与腾讯云官方合作】硅谷课堂项目视频发布
【Laravel】关于Laravel8的composer安装
Practice of curve replacing CEPH in Netease cloud music
visio 使用
使用Karmada实现Helm应用的跨集群部署
【TcaplusDB知识库】查看tcapdir目录服务器
如何登录到你的 WordPress 管理仪表板
Noip2011-2018 problem solving report of improvement group
GCC efficient graph revolution for joint node representationlearning and clustering
WPF video hard decoding, rendering and playing (no airspace) (support 4K, 8K and high frame rate video)
AI落地的新范式,就“藏”在下一场软件基础设施的重大升级里
After the first failure, AMEC rushed to the Hong Kong stock exchange for the second time, and the financial principal changed frequently
The new paradigm of AI landing is "hidden" in the next major upgrade of software infrastructure
【力扣】977. 有序数组的平方
Js中的Bom
PotPlayer播放百度云盘视频
Noip1998-2018 popularization group csp-j2 2019 2020 problem solving report and video
解决sqoop出现 ERROR manager.SqlManager: Generic SqlManager.listDatabases() not implemented