📄 19-2 “settimeout”和“setinterval”函数的缺陷.htm
字号:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312" />
<title>19-2 “setTimeout”和“setInterval”函数的缺陷</title>
<style>
* { font-size:12px; font-family:宋体, Arial; } /*规定了所有的字体样式*/
body { overflow:auto; }
</style>
<script>
function init(){
var obj = new Object();
obj.text = "this is a test";
obj.show = function(){
var o = document.createElement("div");
o.innerHTML = "The text is: " + this.text;
document.body.appendChild(o);
}
obj.show();
setTimeout("obj.show();", 500);
setTimeout(obj.show, 1000);
}
window.onload = init;
</script>
</head>
<body>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -