当前位置:网站首页>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 .
边栏推荐
- 2/12 didn't learn anything
- Maxay paper latex template description
- Ybtoj coloring plan [tree chain dissection, segment tree, tarjan]
- 1291_ Add timestamp function in xshell log
- How to solve the problem of slow downloading from foreign NPM official servers—— Teach you two ways to switch to Taobao NPM image server
- Class A, B, C networks and subnet masks in IPv4
- Yyds dry goods inventory web components series (VII) -- life cycle of custom components
- Global and Chinese market of rubber wheel wedges 2022-2028: Research Report on technology, participants, trends, market size and share
- Développement d'un module d'élimination des bavardages à clé basé sur la FPGA
- P3033 [usaco11nov]cow steelchase g (similar to minimum path coverage)
猜你喜欢
[PSO] Based on PSO particle swarm optimization, matlab simulation of the calculation of the lowest transportation cost of goods at material points, including transportation costs, agent conversion cos
10个 Istio 流量管理 最常用的例子,你知道几个?
1291_ Add timestamp function in xshell log
About some basic DP -- those things about coins (the basic introduction of DP)
Facebook等大廠超十億用戶數據遭泄露,早該關注DID了
1291_Xshell日志中增加时间戳的功能
Esp32 (based on Arduino) connects the mqtt server of emqx to upload information and command control
【按鍵消抖】基於FPGA的按鍵消抖模塊開發
The Research Report "2022 RPA supplier strength matrix analysis of China's banking industry" was officially launched
Recommendation system (IX) PNN model (product based neural networks)
随机推荐
Yyds dry goods inventory web components series (VII) -- life cycle of custom components
颠覆你的认知?get和post请求的本质
MLAPI系列 - 04 - 网络变量和网络序列化【网络同步】
How to modify field constraints (type, default, null, etc.) in a table
How to execute an SQL statement in MySQL
Global and Chinese markets for patent hole oval devices 2022-2028: Research Report on technology, participants, trends, market size and share
Tips for using dm8huge table
POI add border
Security xxE vulnerability recurrence (XXe Lab)
P3033 [usaco11nov]cow steelchase g (similar to minimum path coverage)
【FPGA教程案例12】基于vivado核的复数乘法器设计与实现
[Key shake elimination] development of key shake elimination module based on FPGA
Global and Chinese markets for fire resistant conveyor belts 2022-2028: Research Report on technology, participants, trends, market size and share
Proof of Stirling formula
Prime protocol announces cross chain interconnection applications on moonbeam
How does technology have the ability to solve problems perfectly
Record an excel xxE vulnerability
SSTI template injection explanation and real problem practice
QML和QWidget混合开发(初探)
Développement d'un module d'élimination des bavardages à clé basé sur la FPGA