I think they almost do the same thing. What's the condition that we should choose Web Worker than Ajax?
1 Answer
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.
3 Comments
EasonBlack
Can I say, they are the same thing in client-server communication?
Diodeus - James MacFarlane
No. For example, web workers could be used for something like an animation engine, something that has nothing to do with server communication.
Diodeus - James MacFarlane
You would still use AJAX within a web worker. The web worker is not a communications tool.