timeout.js
来自「这是《JavaScript学习源代码》一书的源代码」· JavaScript 代码 · 共 16 行
JS
16 行
// create and initialize a counter variable
var num = 0;
// a recursive function to display a message
function timeout()
{
// increment the counter
num++;
// display the message
alert("This is 10-Second Message No: " +num );
// set the interval before calling this function again
window.setTimeout("timeout()", 10000);
}
// call the function to start the routine
timeout();
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?