当前位置:网站首页>BOM - location, history, pop-up box, timing
BOM - location, history, pop-up box, timing
2022-07-06 04:11:00 【Sugar ^o^】
One 、History
- Window History Back
history.back() Method loads the previous... In the history list URL. It is equivalent to clicking the back button in the browser .
- Window History Forward
history forward() Method loads the next in the history list URL. Equivalent to clicking the forward button in the browser .
Two 、 pop-up
- Warning box
If you want to ensure that information is passed to users , Warning boxes are usually used .
When the warning box pops up , The user will need to click “ determine ” Come on .
window.alert(“sometext”); window.alert() The method can be without window Prefix to write .
- Confirmation box
If you want users to verify or accept something , Usually use “ confirm ” box .
When the confirmation box pops up , Users will have to click “ determine ” or “ Cancel ” To carry on .
If the user clicks “ determine ”, This box returns true. If the user clicks “ Cancel ”, This box returns false.
grammar window.confirm(“sometext”);
window.confirm() The method can be without window Prefix to write .
- Prompt box
If you want the user to enter a value before entering the page , Usually use the prompt box .
When the prompt box pops up , The user will have to enter a value and click “ determine ” Or click on “ Cancel ” To carry on .
If the user clicks “ determine ”, This box returns the entered value . If the user clicks “ Cancel ”, This box returns NULL.
window.prompt(“sometext”,“defaultText”);
window.prompt() The method can be without window Prefix to write .
3、 ... and 、Timing
setTimeout() Method
window.setTimeout(function, milliseconds); window.setTimeout() The method can be without window Prefix to write .
The first parameter is the function to execute .
The second parameter indicates the number of milliseconds before execution .
clearTimeout()
Method stops execution setTimeout() Functions specified in .
window.clearTimeout(timeoutVariable)
- setInterval() Method
setInterval() Method repeats a given function at each given time interval .
window.setInterval(function, milliseconds);
window.setInterval() The method can be without window Prefix to write .
The first parameter is the function to execute .
The second parameter is the length of the time interval between each execution .
clearInterval()
Method stop setInterval() Method .
window.clearInterval(timerVariable)
Four 、Location
- Window Location Href
window.location.href Property to return the URL
.
document.getElementById(“demo”).innerHTML = " Page location is " + window.location.href;
- Window Location Host name
window.location.hostname Property returns ( Current page ) The Internet host
The name of .
document.getElementById(“demo”).innerHTML = " The page hostname is " +
window.location.hostname;
- Window Location Pathname
window.location.pathname Property to return the Pathname
.
window.location.protocol Property to return to
web
agreementwindow.location.port Property returns ( Current page ) The number of the Internet host port .
window.location.assign() Method to load a new document .
边栏推荐
- Class A, B, C networks and subnet masks in IPv4
- In Net 6 CS more concise method
- The Research Report "2022 RPA supplier strength matrix analysis of China's banking industry" was officially launched
- 绑定在游戏对象上的脚本的执行顺序
- 《2022年中国银行业RPA供应商实力矩阵分析》研究报告正式启动
- 综合能力测评系统
- [FPGA tutorial case 12] design and implementation of complex multiplier based on vivado core
- Global and Chinese markets for patent hole oval devices 2022-2028: Research Report on technology, participants, trends, market size and share
- Data processing methods - smote series and adasyn
- math_ Derivative function derivation of limit & differential & derivative & derivative / logarithmic function (derivative definition limit method) / derivative formula derivation of exponential functi
猜你喜欢
10個 Istio 流量管理 最常用的例子,你知道幾個?
Solution of storage bar code management system in food industry
Recommendation system (IX) PNN model (product based neural networks)
Thread sleep, thread sleep application scenarios
MLAPI系列 - 04 - 网络变量和网络序列化【网络同步】
Record an excel xxE vulnerability
食品行业仓储条码管理系统解决方案
[disassembly] a visual air fryer. By the way, analyze the internal circuit
DM8 backup set deletion
MySQL master-slave replication
随机推荐
Thread sleep, thread sleep application scenarios
关于进程、线程、协程、同步、异步、阻塞、非阻塞、并发、并行、串行的理解
Explain in simple terms node template parsing error escape is not a function
How to execute an SQL statement in MySQL
《2022年中国银行业RPA供应商实力矩阵分析》研究报告正式启动
math_极限&微分&导数&微商/对数函数的导函数推导(导数定义极限法)/指数函数求导公式推导(反函数求导法则/对数求导法)
User datagram protocol UDP
Lombok原理和同时使⽤@Data和@Builder 的坑
综合能力测评系统
/usr/bin/gzip: 1: ELF: not found/usr/bin/gzip: 3: : not found/usr/bin/gzip: 4: Syntax error:
PTA tiantisai l1-078 teacher Ji's return (15 points) detailed explanation
P2648 make money
2/12 didn't learn anything
Use js to complete an LRU cache
Detailed explanation of serialization and deserialization
Viewing and verifying backup sets using dmrman
Record the pit of NETCORE's memory surge
MySQL learning record 13 database connection pool, pooling technology, DBCP, c3p0
MySQL about self growth
Ybtoj coloring plan [tree chain dissection, segment tree, tarjan]