self_example/java_web/JavaScript/html/12-window对象.html

46 lines
809 B
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>12-window对象</title>
</head>
<body>
<script>
//alert
// window.alert("abc");
// alert("bbb");
//confirm,点击确定按钮返回true,点击取消返回false
// var flag = confirm("确认删除?");
//
// if(flag){
// //删除逻辑
// }else {
// //
// }\
//定时器
/**
* setTimeout(function,毫秒值):在一定的时间间隔后执行一个function,只执行一次
*
* setInterval(function,毫秒值):在一定的时间间隔后执行一个function,循环执行
*/
// setTimeout(function () {
// alert("hehe");
// },3000);
setInterval(function () {
alert("hehe");
}, 2000);
</script>
</body>
</html>