Pregunta de entrevista de Google

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

Respuestas de entrevistas

Anónimo

28 nov 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.

Anónimo

11 jul 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.