Quick JavaScript Interview Questions by Patel Sandeep

Quick JavaScript Interview Questions by Patel Sandeep

Author:Patel, Sandeep
Language: eng
Format: epub
Published: 2015-06-05T04:00:00+00:00


Chapter 10 Web Workers

Q. What is a Web Worker?

ANSWER

Web Workers are new HTML5 feature to achieve concurrency in JavaScript execution in web application. A web worker is JavaScript file which run in the background of the browser without impacting the page performance. This helps in resolve the age old problem “Un responsive script alert box”. Generally these workers can be used for extensive computation purpose.

Q. How to detect Web Worker is supported by browser? ANSWER

We can check the support of Web Worker in a browser by validating the Worker property is present in the window object. Code for checking Web Worker support is as follows:

<!DOCTYPE html>

<html>

<head lang="en">

<title>Web Worker</title>

</head>

<body>



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.