-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbom-lec.html
More file actions
59 lines (48 loc) · 1.52 KB
/
bom-lec.html
File metadata and controls
59 lines (48 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BOM Lesson</title>
</head>
<body>
<h1>This is the BOM</h1>
<script>
(function(){
"use strict";
// TODO: Write a setInterval()
var count = 0;
var max = 10;
var interval = 1000;
var intervalId = setInterval(function(){
if(count >= max){
// clearInterval does NOT exit this block of code
console.log('All done.');
clearInterval(intervalId);
} else {
count++;
console.log("Repeating this line" + count);
}
}, interval);
console.log(intervalId);
function sayHello(){
console.log("Hello there!");
}
// setInterval(sayHello,interval);
//10 seconds?
var delay = 5000;
var timeoutId = setTimeout(function(){
console.log("you have 5 seconds.");
alert("Refreshing the page!");
// window.location = 'https://java.codeup.com/javascript-i/bom-and-dom/bom/';
location.reload();
},delay);
})();
// alert("This is a test");
// var yourName = prompt("Enter your name");
// var answer = confirm("Are you in the Jupiter cohort?");
//
// console.log(yourName);
// console.log(answer);
</script>
</body>
</html>