-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
35 lines (31 loc) · 808 Bytes
/
index.html
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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Demo</title>
<script src="worker_lib.js"></script>
</head>
<body>
<script>
let work = new AsyncWorker({
sayHello: helloFunction,
changeNameTo: function(newName) {
this.your_name = newName;
return true;
},
your_name: 'unknown'
});
function helloFunction(name) {
console.info("Hello", this.your_name, "from", name);
}
console.debug("Worker:", work);
work.your_name = "Genius";
//work.changeNameTo("Jochen").then(function() {
console.log("Your Name is:", work.your_name);
work.sayHello("Someone").catch(function (error) {
console.error("ERROR:", error);
});
//}).catch(function (error) { console.error("ERROR:", error); });
</script>
</body>
</html>