当前位置:网站首页>Detailed explanation of various objects in browser object
Detailed explanation of various objects in browser object
2022-06-11 23:32:00 【A-linWeb】
window object Represents an open window in the browser .
alert() pop-up
confirm() Confirmation box
prompt () The text box
Various boxes Test code usage Formal projects are not recommended Because they block the code Various plug-in libraries are recommended
navigator object That is, it contains information about the browser
navigator.platform: Type of operating system ;
navigator.userAgent: Browser set User - Agent character string .
navigator.appCodeName: Browser code ;
navigator.appName: Browser name ;
navigator.appVersion: Browser version ;
navigator.language: Language for browser settings ;
navigator.systemLanguage: Browser system language ;
navigator.cookieEnabled: Whether the browser is enabled cookie
console.log(navigator.userAgent); // Can be used to determine the browser
console.log(navigator.language); // Browser language .
console.log(navigator.systemLanguage); // The language of the operating system .
location object Contains information about the current URL Information about
location.href // Get the complete url Information
location.protocol // obtain url Agreement name in http:
location.host // obtain url Host name in With port number ip Address / domain name
location.hostname // obtain url Host name in No port number
location.pathname // obtain url In the path File location
location.search // obtain url The query string in
location.hash // obtain url Fragments in
location.port // Get the port number
Important methods
Refresh
1.location.reload();// Reload page , Refresh the page , Equivalent to pressing f5
2. location.href = location.href // location.href It is essentially used to jump to another URL Address Can be used to refresh
3.location.assign()//location.assign() Assign a new value to the address Can be used to jump It can also be used to step back
4. location.replace() // location.replace() Can be used to jump But you can't go back
history object The history object is mainly used for advancing between pages , Backward operation
history.back()
history.forward()
history.go()
"history.go(1)" Take a step forward
"history.go(2)" Two steps forward
history.replaceState(“ Add data , It can be a basic type , It can also be a reference type ”, “ title ”, “two.html”); // You can also perform jump operations ( Only modified url Address , No jump ), History will not be added during jump . Can't go forward or backward
history.pushState(“ Add data , It can be a basic type , It can also be a reference type ”, “ title ”, “two.html”); // You can also perform jump operations ( Only modified url Address , No jump ), History will be added during jump .
screen object Contains information about the client display screen .
window.screen.availWidth
window.screen.availHeight
边栏推荐
- Discrete mathematics attention points, priority problems
- Delete the receiving address [project mall]
- Here we go! Dragon lizard community enters PKU classroom
- CVPR 2022 | 元学习在图像回归任务的表现
- RF中使用reuqests的两种方式
- 2022 R1 quick opening pressure vessel operation test questions and online simulation test
- 2022年安全员-A证考题模拟考试平台操作
- 免费分享1个新媒体运营必备的宝藏网站
- 一文读懂Logstash原理
- Antigen products enter the family, and Chinese medical device enterprises usher in a new blue ocean
猜你喜欢
![[day15 literature extensive reading] numerical magnetic effects temporary memories but not time encoding](/img/57/9ce851636b927813a55faedb4ecd48.png)
[day15 literature extensive reading] numerical magnetic effects temporary memories but not time encoding

Solr之基础讲解入门

Implementation scheme of iteration and combination pattern for general tree structure

【Day1/5 文献精读】Speed Constancy or Only Slowness: What Drives the Kappa Effect

Lake Shore - supertran VP continuous flow cryogenic thermostat system
![Vs code writing assembly code [microcomputer principle]](/img/fc/e32262fcd80841ba7b82882a89ad0b.png)
Vs code writing assembly code [microcomputer principle]

Fonctionnement de la plate - forme d'examen de simulation pour les agents de sécurité - Questions d'examen de certificat a en 2022

【Day4 文献精读】Space–time interdependence: Evidence against asymmetric mapping between time and space

2022安全员-C证判断题模拟考试平台操作

2022年R1快开门式压力容器操作考题及在线模拟考试
随机推荐
Two way leading circular linked list (C language)
SDNU_ ACM_ ICPC_ 2022_ Weekly_ Practice_ 1st (supplementary question)
04 automatic learning rate - learning notes - lihongyi's in-depth learning 2021
【Day3 文献精读】Asymmetrical time and space interference in Tau and Kappa effects
MySQL 8.0 解压版安装教程
Research Report on development trend and competitive strategy of global metallized high barrier film industry
2022安全员-C证判断题模拟考试平台操作
Delete the receiving address [project mall]
2022 high voltage electrician test question simulation test question bank and online simulation test
2022年R1快开门式压力容器操作考题及在线模拟考试
[day4 literature intensive reading] space – time interdependence: evidence against Asymmetric mapping between time and space
[day13-14 intensive literature reading] cross dimensional magnetic interactions arise from memory interference
05 classification learning notes lihongyi's in-depth study 2021
Pourquoi Google Search ne peut - il pas Pager indéfiniment?
2022年安全员-A证考题模拟考试平台操作
Cisco private dynamic routing protocol: EIGRP
[naturallanguageprocessing] [multimodal] albef: visual language representation learning based on momentum distillation
2022年安全員-A證考題模擬考試平臺操作
2022年安全员-B证理论题库及模拟考试
删除收货地址【项目 商城】