?? 19-2 “settimeout”和“setinterval”函數(shù)的缺陷.htm
字號(hào):
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312" />
<title>19-2 “setTimeout”和“setInterval”函數(shù)的缺陷</title>
<style>
* { font-size:12px; font-family:宋體, Arial; } /*規(guī)定了所有的字體樣式*/
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>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -