当前位置:网站首页>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
webagreementwindow.location.port Property returns ( Current page ) The number of the Internet host port .
window.location.assign() Method to load a new document .
边栏推荐
- Lombok原理和同时使⽤@Data和@Builder 的坑
- P2648 make money
- Determine which week of the month the day is
- Execution order of scripts bound to game objects
- asp. Core is compatible with both JWT authentication and cookies authentication
- Hashcode and equals
- Class A, B, C networks and subnet masks in IPv4
- C (XXIX) C listbox CheckedListBox Imagelist
- 综合能力测评系统
- Thread sleep, thread sleep application scenarios
猜你喜欢

C language -- structs, unions, enumerations, and custom types

Ks003 mall system based on JSP and Servlet

Yyds dry goods inventory web components series (VII) -- life cycle of custom components
![Cf464e the classic problem [shortest path, chairman tree]](/img/6b/65b2dc62422a45cc72f287c38dbc58.jpg)
Cf464e the classic problem [shortest path, chairman tree]

lora网关以太网传输

Ks008 SSM based press release system

About some basic DP -- those things about coins (the basic introduction of DP)

Stable Huawei micro certification, stable Huawei cloud database service practice

MLAPI系列 - 04 - 网络变量和网络序列化【网络同步】

Data processing methods - smote series and adasyn
随机推荐
Basic knowledge of binary tree, BFC, DFS
Global and Chinese market of aircraft anti icing and rain protection systems 2022-2028: Research Report on technology, participants, trends, market size and share
HotSpot VM
综合能力测评系统
Path of class file generated by idea compiling JSP page
Plus d'un milliard d'utilisateurs de grandes entreprises comme Facebook ont été compromis, il est temps de se concentrer sur le did
ESP32(基于Arduino)连接EMQX的Mqtt服务器上传信息与命令控制
1291_ Add timestamp function in xshell log
Ybtoj coloring plan [tree chain dissection, segment tree, tarjan]
Stable Huawei micro certification, stable Huawei cloud database service practice
题解:《单词覆盖还原》、《最长连号》、《小玉买文具》、《小玉家的电费》
颠覆你的认知?get和post请求的本质
Figure application details
Detailed explanation of serialization and deserialization
Oracle ORA error message
math_极限&微分&导数&微商/对数函数的导函数推导(导数定义极限法)/指数函数求导公式推导(反函数求导法则/对数求导法)
Python book learning notes - Chapter 09 section 01 create and use classes
[FPGA tutorial case 12] design and implementation of complex multiplier based on vivado core
Global and Chinese market of plasma separator 2022-2028: Research Report on technology, participants, trends, market size and share
[Key shake elimination] development of key shake elimination module based on FPGA