What is the purpose of Web Workers API?

 Posted by Niladri.Biswas on 9/11/2012 | Category: HTML 5 Interview questions | Views: 3413 | Points: 40
Answer:

If we need to execute a JavaScript file asynchronously and autonomously, we need to take help of Web Workers API. It is a thread that executes a java-script file.It helps to achieve multi threading in web application.

e.g. var worker = new Worker("http://xyz.com/somejsfile.js");


The above code will execute the somejsfile.js - javascript file that has been passed inside the Worker() method.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response