-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
29 lines (25 loc) · 843 Bytes
/
index.html
File metadata and controls
29 lines (25 loc) · 843 Bytes
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
<style>
#textLog{
width:100%;
height:300px;
}
</style>
<script src="app.js"></script>
<h1>WebWorkers</h1>
<textarea id="textLog" readonly></textarea>
<button id='start1'>Run Script</button>
<script>
var button1 = document.getElementById("start1");
var log1 = document.getElementById("textLog");
/*** Example of appWorker implementation ***/
var callbackfunction = function(x){
log1.value = "Seconds: " + x;
}
button1.addEventListener("click",function(){
log1.value = "Script Started";
appWorker.make("counter","counter.js");
appWorker.run("counter","start",callbackfunction)
});
/*******************************************/
log1.value = (window.Worker)? "window.Worker = " + window.Worker : "Worker not available on this browser";
</script>