diff --git a/demos/computingSquareRoots.htm b/demos/computingSquareRoots.htm new file mode 100644 index 0000000..a06207e --- /dev/null +++ b/demos/computingSquareRoots.htm @@ -0,0 +1,117 @@ + + + +Workers : table + + +
+

+
+ + + + + diff --git a/js/computingSquareRoots.js b/js/computingSquareRoots.js new file mode 100644 index 0000000..2c454fa --- /dev/null +++ b/js/computingSquareRoots.js @@ -0,0 +1,11 @@ +onmessage=function(event) { + if ( event.data =="hello") { + postMessage("I'm here !"); + } + else { + obj=JSON.parse(event.data); + rep={ id : obj.id , line : obj.line.map(Math.sqrt) } + postMessage(JSON.stringify(rep) ); + close(); + } +}