当前位置:网站首页>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.
边栏推荐
- Bool blind note - score query
- 3. Data binding
- Typora charges, WTF? Still need support
- How to read the source code [debug and observe the source code]
- How to modify the network IP addresses of mobile phones and computers?
- Micro service knowledge sorting - three pieces of micro Service Technology
- 【c】 Digital bomb
- Oak-d raspberry pie cloud project [with detailed code]
- Camera calibration (I): robot hand eye calibration
- Qtablewidget control of QT
猜你喜欢
Oak-d raspberry pie cloud project [with detailed code]
jvm jni 及 pvm pybind11 大批量数据传输及优化
Machine learning support vector machine SVM
Use of aggregate functions
How to improve data security by renting servers in Hong Kong
Introduction to golang garbage collection
From the behind the scenes arena of the ice and snow event, see how digital builders can ensure large-scale events
JMeter plug-in installation
The global industrial design revenue in 2021 was about $44360 million, and it is expected to reach $62720 million in 2028. From 2022 to 2028, the CAGR was 5.5%
How to handle wechat circle of friends marketing activities and share production and release skills
随机推荐
1.5 learn to find mistakes first
Change deepin to Alibaba image source
[effective Objective-C] - block and grand central distribution
6. Data agent object Defineproperty method
Derivation of decision tree theory
Find a line in a file and remove it
Global and Chinese market of high temperature Silver sintering paste 2022-2028: Research Report on technology, participants, trends, market size and share
Commands related to files and directories
Explore the internal mechanism of modern browsers (I) (original translation)
Nerfplusplus parameter format sorting
Wechat applet quick start (including NPM package use and mobx status management)
18、 MySQL -- index
Wargames study notes -- Leviathan
Virtual machine installation deepin system
Global and Chinese market of full authority digital engine control (FADEC) 2022-2028: Research Report on technology, participants, trends, market size and share
PR notes:
The simplicity of laravel
Global and Chinese market of two in one notebook computers 2022-2028: Research Report on technology, participants, trends, market size and share
MPLS configuration
Popularize the basics of IP routing