当前位置:网站首页>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.
边栏推荐
- 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
- Typora charges, WTF? Still need support
- An old programmer gave it to college students
- 2.5 conversion of different data types (2)
- Upgrade PIP and install Libraries
- Global and Chinese market of micro positioning technology 2022-2028: Research Report on technology, participants, trends, market size and share
- Sparse matrix (triple) creation, transpose, traversal, addition, subtraction, multiplication. C implementation
- 1.4 learn more about functions
- Fingerprint password lock based on Hal Library
- [postgresql]postgresql custom function returns an instance of table type
猜你喜欢

Exercises of function recursion

Camera calibration (I): robot hand eye calibration

Use of aggregate functions

JVM JNI and PVM pybind11 mass data transmission and optimization

Based on laravel 5.5\5.6\5 X solution to the failure of installing laravel ide helper

String and+

Detailed and not wordy. Share the win10 tutorial of computer reinstallation system

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

JMeter plug-in installation

Shortest path problem of graph theory (acwing template)
随机推荐
Global and Chinese market of micro positioning technology 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese market of electrolyte analyzers 2022-2028: Research Report on technology, participants, trends, market size and share
3. Data binding
Bool blind note - score query
2.2 integer
Micro service knowledge sorting - asynchronous communication technology
MySQL 8.0 data backup and recovery
Research Report on the overall scale, major manufacturers, major regions, products and application segmentation of rotary tablet presses in the global market in 2022
Global and Chinese markets of active matrix LCD 2022-2028: Research Report on technology, participants, trends, market size and share
18、 MySQL -- index
Global and Chinese markets of lithium chloride 2022-2028: Research Report on technology, participants, trends, market size and share
The 29th day of force deduction (DP topic)
Producer consumer mode (multithreading, use of shared resources)
Basic knowledge of dictionaries and collections
Microservice framework - frequently asked questions
Example of peanut shell inner net penetration
Global and Chinese market of rubidium standard 2022-2028: Research Report on technology, participants, trends, market size and share
Blue Bridge Cup: the fourth preliminary - "simulated intelligent irrigation system"
Preliminary practice of niuke.com (11)
AcWing 1460. Where am i?