webveuje/js/demo/dingshiqi.html

38 lines
858 B
HTML
Raw Permalink Normal View History

2021-03-23 10:58:10 +08:00
<!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>