Computer Science, asked by suhani6048, 11 months ago

html coding for my school on the basis of class 10​

Answers

Answered by 3140
2

<!DOCTYPE html>

<html>

<body>

<p>Count numbers: <output id="result"></output></p>

<button onclick="startWorker()">Start Worker</button>

<button onclick="stopWorker()">Stop Worker</button>

<p><strong>Note:</strong> Internet Explorer 9 and earlier versions do not support Web Workers.</p>

<script>

var w;

function startWorker() {

 if(typeof(Worker) !== "undefined") {

   if(typeof(w) == "undefined") {

     w = new Worker("demo_workers.js");

   }

   w.onmessage = function(event) {

     document.getElementById("result").innerHTML = event.data;

   };

 } else {

   document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Workers...";

 }

}

function stopWorker() {

 w.terminate();

 w = undefined;

}

</script>

</body>

</html>

Similar questions