当前位置:网站首页>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.
边栏推荐
- 3. Data binding
- 阻塞非阻塞和同步异步的区分 参考一些书籍
- Typora charges, WTF? Still need support
- Global and Chinese market of charity software 2022-2028: Research Report on technology, participants, trends, market size and share
- AcWing 1460. Where am i?
- How to modify the network IP addresses of mobile phones and computers?
- Nerfplusplus parameter format sorting
- Instructions for common methods of regular expressions
- Point cloud data denoising
- Get log4net log file in C - get log4net log file in C
猜你喜欢

Derivation of decision tree theory

44. Concurrent programming theory

Camera calibration (I): robot hand eye calibration

19、 MySQL -- SQL statements and queries

How to modify the network IP addresses of mobile phones and computers?

Qtablewidget control of QT

Node MySQL serialize cannot rollback transactions

Explore the internal mechanism of modern browsers (I) (original translation)

Introduction to golang garbage collection

Do you really know how old you are?
随机推荐
Don't be afraid of no foundation. Zero foundation doesn't need any technology to reinstall the computer system
Test changes in Devops mode -- learning and thinking
It is discussed that the success of Vit lies not in attention. Shiftvit uses the precision of swing transformer to outperform the speed of RESNET
Micro service knowledge sorting - three pieces of micro Service Technology
An old programmer gave it to college students
Global and Chinese market of full authority digital engine control (FADEC) 2022-2028: Research Report on technology, participants, trends, market size and share
Battle drag method 1: moderately optimistic, build self-confidence (1)
Test access criteria
MDM mass data synchronization test verification
AST (Abstract Syntax Tree)
18、 MySQL -- index
Thread, thread stack, method stack, the difference of creating thread
How to check the permission to write to a directory or file- How do you check for permissions to write to a directory or file?
From the behind the scenes arena of the ice and snow event, see how digital builders can ensure large-scale events
Global and Chinese market of high purity copper foil 2022-2028: Research Report on technology, participants, trends, market size and share
Cannot load driver class: com. mysql. cj. jdbc. Driver
Rad+xray vulnerability scanning tool
Microsoft: the 12th generation core processor needs to be upgraded to win11 to give full play to its maximum performance
How can the outside world get values when using nodejs to link MySQL
JVM JNI and PVM pybind11 mass data transmission and optimization