Pergunta de entrevista da empresa Google

Browsers running javascript is single threaded, how can we make AJAX calls in the backgroung?

Respostas da entrevista

Sigiloso

28 de nov. de 2012

JavaScript is single threaded, but AJAX is *asynchronous* (by default), so it runs in a background. If we need another thread, we can use web workers.

Sigiloso

11 de jul. de 2012

We can use Javascript to make AJAX call in the background. Ex:For Chating ,we need to update the content of chat after every one or three sec so we call the javascript function once and then we use javascript inbuild function Settimeout() which call ajax in the background.