JS中window对象的使用
来源:互联网 发布:淘宝会员注册网站 编辑:程序博客网 时间:2024/06/05 19:44
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>window对象的使用</title> <!-- 作者:李瑞琦 时间:2017-08-23 描述: --> <script type="text/javascript"> function testAlert(){ window.alert("我是警告框"); } function testConfirm(){ var flag = window.confirm("你确定要退出吗"); } function testPrompt(){ var flag = window.prompt("请输入昵称"); } //定时执行 //定义全局变量记录线程id var id; var num; //定时执行 function testTimeOut(){ id = window.setTimeout(function(){ alert("定时执行"); },2000); } //结束定时执行的线程 function clearTimeOut(){ window.clearTimeout(id); } //间隔执行 function testInterval(){ num = window.setInterval(function(){ alert("间隔执行") },3000); } //结束间隔执行的线程 function clearInterval(){ window.clearInterval(num); } </script> </head> <body> <h3>window对象的使用</h3> <hr /> <input type="button" id="" name="" value="testAlert" onclick="testAlert()" /> <input type="button" id="" name="" value="testConfirm" onclick="testConfirm()" /> <input type="button" id="" name="" value="testPrompt" onclick="testPrompt()" /> <hr /> <input type="button" id="" name="" value="testTimeout" onclick="testTimeOut()" /> <input type="button" id="" name="" value="testClearTimeout" onclick="clearTimeOut()" /> <input type="button" id="" name="" value="testInterval" onclick="testInterval()" /> <input type="button" id="" name="" value="clearInterval" onclick="clearInterval()" /> </body></html>
阅读全文
0 0
- JS中window对象的使用
- js中WINDOW对象
- JS中window对象的常用方法
- js中window对象的常用函数
- JS的window对象
- JS的window对象
- js的window对象
- JS中document对象和window对象的区别
- JS中document对象和window对象的区别
- HTML:js中Window对象的常用属性:screen对象
- 读书笔记----js中window对象
- Js之window对象使用
- JS中window.open和window.opener的使用
- JS中window.open和window.opener的使用
- window对象 的使用
- JS 使用 window对象的print方法实现分页打印
- JS 使用 window对象的print方法实现分页打印
- js window的使用
- ccf 201612-4 压缩编码
- 【SikuliX】SikuliX+Vysor实现安卓app自动化测试
- 常用开关电源拓扑演进
- Hadoop小案例
- 在参数封装对象Page中使用in查询多项数据记录
- JS中window对象的使用
- js 数值操作(floor ceil abs round)
- Linux之解压缩常用命令
- Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
- leetcode之排序题目总结
- 写一个编程题把ttt5yjd-jdd4yh转换成tttyyyyyjd@jddyyyyh
- 题目6:喷水装置(一)
- OpenCV中矩阵的归一化
- Android面试(Service部分)