Possible Duplicate:
Is javascript guaranteed to be single-threaded?
Javascript works as single thread.But ajax works asynchronous, So what's the mechanism of it.It calls the setTimeouts and setInterval?
how dose the javascript code know that the ajax call has finished. By polling? it asks the server if the call is finished every 1ms?