当前位置:网站首页>Operate BOM objects (key)
Operate BOM objects (key)
2022-07-03 20:25:00 【Sicheng code block】
Hello everyone , Today, let's share the operation BOM object
BOM: Browser object model
JavaScript And the browser was born so that it can run on the browser
browser :
IE
Chrome
Safari
FireFox
Third party browsers
qq browser
360 browser
window object
window For browser window 
window.alert(1)
undefined
window.innerHeight
1440
window.innerWidth
669
window.outerHeight
360
window.outerHeight
360
window.outerWidth
167
window.navigator.appName
'Netscape'
window.navigator.appVersion
'5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Mobile Safari/537.36'
window.navigator.userAgent
'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Mobile Safari/537.36'
window.navigator.platform
'Win32'
Most of the time , We don't recommend it navigator object , Because these can be artificially modified
screen
Represents the screen size
screen.width
804
screen.height
625
location( important )
Representing the current page URL Information
Screenshot :
host: "www.baidu.com"
href:"https ://www.baidu.com/"
protocol : "https:"
reload :f reload () // Refresh web page
location.assign('https://www.xxxx.com/' )
') // Add a new web page after it
Location {ancestorOrigins: DOMStringList, href:
‘https://www.baidu.com/’, origin: ‘https://www.baidu.com’, protocol:
‘https:’, host: ‘www.baidu.com’, …}ancestorOrigins: DOMStringList
{length: 0}assign: ƒ assign()hash: ""host: "www.baidu.com"hostname:
"www.baidu.com"href: "https://www.baidu.com/"origin:
"https://www.baidu.com"pathname: "/"port: ""protocol: "https:"reload:
ƒ reload()replace: ƒ replace()search: ""toString: ƒ toString()valueOf:
ƒ valueOf()Symbol(Symbol.toPrimitive): undefined[[Prototype]]:
Location
document
document Represents the current page ,
document.title
' use Baidu Search '
Screenshot :

Write a source code :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<dl id="app">
<dt>java</dt>
<dd>docker</dd>
<dd>mysql</dd>
</dl>
<script>
var dl=document.getElementById('app');
</script>
</head>
<body>
</body>
</html>
effect :


He can get specific document tree nodes
obtain cookie value
document.cookie
Screenshot :
This cookie There is a lot of information about the client host in the value
For safety's sake ,
The server can be set up cookie: httpOnly
history: About the URL Information about ( Historical record )

Search for something casually on Baidu
history.forward()

Back here
history.forward() // Forward
history.forward() // Back off
Okay , operation BOM That's all for the object , Thank you.
边栏推荐
- Sightseeing - statistics of the number of shortest paths + state transfer + secondary small paths
- Blue Bridge Cup: the fourth preliminary - "simulated intelligent irrigation system"
- 11-grom-v2-04-advanced query
- Global and Chinese markets of polyimide tubes for electronics 2022-2028: Research Report on technology, participants, trends, market size and share
- Global and Chinese market of liquid antifreeze 2022-2028: Research Report on technology, participants, trends, market size and share
- Teach you how to quickly recover data by deleting recycle bin files by mistake
- Don't be afraid of no foundation. Zero foundation doesn't need any technology to reinstall the computer system
- Leetcode daily question solution: 540 A single element in an ordered array
- Geek Daily: the system of monitoring employees' turnover intention has been deeply convinced off the shelves; The meta universe app of wechat and QQ was actively removed from the shelves; IntelliJ pla
- 1.5 learn to find mistakes first
猜你喜欢

In 2021, the global revenue of syphilis rapid detection kits was about US $608.1 million, and it is expected to reach US $712.9 million in 2028

FPGA 学习笔记:Vivado 2019.1 工程创建

Test panghu was teaching you how to use the technical code to flirt with girls online on Valentine's Day 520
![Oak-d raspberry pie cloud project [with detailed code]](/img/34/76b461bf03fba373da5b5898c5204c.jpg)
Oak-d raspberry pie cloud project [with detailed code]

jvm jni 及 pvm pybind11 大批量数据传输及优化

Wechat applet quick start (including NPM package use and mobx status management)

Geek Daily: the system of monitoring employees' turnover intention has been deeply convinced off the shelves; The meta universe app of wechat and QQ was actively removed from the shelves; IntelliJ pla

FAQs for datawhale learning!

Network security Kali penetration learning how to get started with web penetration how to scan based on nmap

2.7 format output of values
随机推荐
FPGA learning notes: vivado 2019.1 project creation
Sword finger offer 30 Stack containing min function
Example of peanut shell inner net penetration
Professional interpretation | how to become an SQL developer
Introduction to golang garbage collection
About callback function and hook function
强基计划 数学相关书籍 推荐
Point cloud data denoising
Microsoft: the 12th generation core processor needs to be upgraded to win11 to give full play to its maximum performance
Viewing Chinese science and technology from the Winter Olympics (II): when snowmaking breakthrough is in progress
19、 MySQL -- SQL statements and queries
Basic knowledge of dictionaries and collections
4. Data splitting of Flink real-time project
Test access criteria
Global and Chinese market of charity software 2022-2028: Research Report on technology, participants, trends, market size and share
LabVIEW training
Test panghu was teaching you how to use the technical code to flirt with girls online on Valentine's Day 520
Analysis of gas fee setting under eip1559
2.2 integer
Cannot load driver class: com. mysql. cj. jdbc. Driver