好久没更新了
This commit is contained in:
38
js/demo/dingshiqi.html
Normal file
38
js/demo/dingshiqi.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script>
|
||||
// 每三秒打印一次“Hello”
|
||||
var h = setInterval(function () {
|
||||
console.log("hello")
|
||||
}, 3000)
|
||||
setTimeout(function () {
|
||||
clearInterval(h)
|
||||
}, 9000)
|
||||
|
||||
(function () {
|
||||
var m = 0;
|
||||
function getM() {
|
||||
return m;
|
||||
}
|
||||
function seta(val) {
|
||||
m = val;
|
||||
}
|
||||
window.g = getM;
|
||||
window.f = seta;
|
||||
})();
|
||||
f(100);
|
||||
console.info(g());
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user