当前位置:网站首页>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 .
边栏推荐
- Scalpel like analysis of JVM -- this article takes you to peek into the secrets of JVM
- Tips for using dm8huge table
- [FPGA tutorial case 12] design and implementation of complex multiplier based on vivado core
- Explain in simple terms node template parsing error escape is not a function
- Facebook等大廠超十億用戶數據遭泄露,早該關注DID了
- 绑定在游戏对象上的脚本的执行顺序
- R note prophet
- Basic knowledge of binary tree, BFC, DFS
- 【按鍵消抖】基於FPGA的按鍵消抖模塊開發
- QML和QWidget混合开发(初探)
猜你喜欢

Stack and queue

10个 Istio 流量管理 最常用的例子,你知道几个?

Ks003 mall system based on JSP and Servlet

No qualifying bean of type ‘......‘ available

What is the difference between gateway address and IP address in tcp/ip protocol?
![[Zhao Yuqiang] deploy kubernetes cluster with binary package](/img/45/6777fa919386e526dbb0d2c808a7f2.jpg)
[Zhao Yuqiang] deploy kubernetes cluster with binary package

Stable Huawei micro certification, stable Huawei cloud database service practice

Interface idempotency

【按鍵消抖】基於FPGA的按鍵消抖模塊開發
![[introduction to Django] 11 web page associated MySQL single field table (add, modify, delete)](/img/8a/068faf3e8de642c9e3c4118e6084aa.jpg)
[introduction to Django] 11 web page associated MySQL single field table (add, modify, delete)
随机推荐
MySql數據庫root賬戶無法遠程登陸解决辦法
Solution of storage bar code management system in food industry
Le compte racine de la base de données MySQL ne peut pas se connecter à distance à la solution
80% of the diseases are caused by bad living habits. There are eight common bad habits, which are both physical and mental
【FPGA教程案例11】基于vivado核的除法器设计与实现
Mathematical modeling regression analysis relationship between variables
Codeforces Round #770 (Div. 2) B. Fortune Telling
Custom event of C (31)
ESP32(基于Arduino)连接EMQX的Mqtt服务器上传信息与命令控制
Basic knowledge of binary tree, BFC, DFS
IDEA编译JSP页面生成的class文件路径
The global and Chinese market of negative pressure wound therapy unit (npwtu) 2022-2028: Research Report on technology, participants, trends, market size and share
查询mysql数据库中各表记录数大小
软考 系统架构设计师 简明教程 | 总目录
Execution order of scripts bound to game objects
Solution to the problem that the root account of MySQL database cannot be logged in remotely
Cf603e pastoral oddities [CDQ divide and conquer, revocable and search set]
Esp32 (based on Arduino) connects the mqtt server of emqx to upload information and command control
Detailed explanation of serialization and deserialization
POI add border