9

I think they almost do the same thing. What's the condition that we should choose Web Worker than Ajax?

1 Answer 1

10

AJAX is specifically for communicating with a server, whereas web workers are a for background processing.

While AJAX is asynchronous (by default), this is not to be confused with a "concurrent" model of background processing that web workers offer.

A web worker could be any process and is not restricted to client-server communication.

Sign up to request clarification or add additional context in comments.

3 Comments

Can I say, they are the same thing in client-server communication?
No. For example, web workers could be used for something like an animation engine, something that has nothing to do with server communication.
You would still use AJAX within a web worker. The web worker is not a communications tool.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.