Google Interview Question: Browsers running javascript i... | Glassdoor

Interview Question

Software Development Engineer Interview Mountain View, CA

Browsers running javascript is single threaded, how can we

  make AJAX calls in the backgroung?
javascript ajax

Interview Answer

2 Answers


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.

Durlabh Kumar Jha on Jul 11, 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.

ciembor on Nov 27, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.