How to force a program to wait until an HTTP request is finished in JavaScript?
EDIT: Synchronous requests are now deprecated; you should always handle HTTP requests in an async way. There is a 3rd parameter to XmlHttpRequest‘s open(), which aims to indicate that you want the request to by asynchronous (and so handle the response through an onreadystatechange handler). So if you want it to be synchronous (i.e. wait … Read more