-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrowser-example.html
More file actions
38 lines (36 loc) · 1.02 KB
/
browser-example.html
File metadata and controls
38 lines (36 loc) · 1.02 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>OK, Now... Example</title>
<script type="text/javascript" src="./oknow.js"></script>
</head>
<body>
<p id="content">Initializing...</p>
<script type="text/javascript">
function write(ok) {
document.getElementById("content").innerHTML += "<br>Writing something after 2000 ms from now";
setTimeout(function() {
document.getElementById("content").innerHTML += "<br>This is a sample writing.";
ok();
}, 2000);
}
write
.after(function(ok) {
setTimeout(function() {
document.getElementById("content").innerHTML += "<br>This is called after writing finishes.";
ok();
}, 1000);
})
.after(function(ok) {
setTimeout(function() {
document.getElementById("content").innerHTML += "<br>This will pass a value '10' to next call.";
ok(10);
}, 1000);
})
.after(function(ok, val) {
document.getElementById("content").innerHTML += "<br>Value received from previous call was: " + val;
});
</script>
</body>
</html>