当前位置:网站首页>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
边栏推荐
- Can SQL queries be used in the tablestore to find out all the data in the table?
- A simple reflective XSS operation and idea
- visio 使用
- 3. caller service call - dapr
- General solution of island problems and DFS framework
- 【TcaplusDB知识库】TcaplusDB技术支持介绍
- 【尚硅谷与腾讯云官方合作】硅谷课堂项目视频发布
- 岛屿类问题通用解法与DFS框架
- 如何登录到你的 WordPress 管理仪表板
- C#/VB. Net to convert PDF to excel
猜你喜欢

解决sqoop出现 ERROR manager.SqlManager: Generic SqlManager.listDatabases() not implemented

【TcaplusDB知识库】TcaplusDB限制条件介绍

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

【TcaplusDB】祝大家端午安康!

大促场景下,如何做好网关高可用防护

Cloud sports, 360 ° witnessing speed and passion

Introduction to LTSpice circuit simulation

Super automation and the future of network security

基于DataWorks的时效仿真平台|得物技术

The first place on the list - brake by wire "new cycle", the market competitiveness of local suppliers is TOP10
随机推荐
R 编程语言 - 简介
O & M - unified gateway is very necessary
如何在网站上安装 WordPress
Code implementation of gain (4) -- gap dataset missing data filling based on GaN (sequence) [improved version]
Coding Devops helps Sinochem information to build a new generation of research efficiency platform and drive the new future of "online Sinochem"
【TcaplusDB】祝大家端午安康!
论文解读(GCC)《Efficient Graph Convolution for Joint Node RepresentationLearning and Clustering》
Written interview algorithm classic - longest palindrome substring
编写自己的 WordPress 模板
【Redis】2021/01/31 Redis的简单归纳 No.01
The future of platform as code is kubernetes extension
中金证券经理给的开户链接安全吗?找谁可以开户啊?
NOIP1998-2018年普及组 CSP-J2 2019 2020 解题报告及视频
6 - 字典
How to query all the data in a table in the database?
免费、强大、高颜值的笔记软件评测: OneNote、Heptabase、氢图、FlowUs
岛屿类问题通用解法与DFS框架
怎么期货开户?在哪里期货开户比较安全?
How to log in to your WordPress admin dashboard
软件快速交付真的需要以安全为代价吗?