38 lines
858 B
HTML
38 lines
858 B
HTML
<!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> |