O'Reilly logo

JavaScript JSON Cookbook by Ray Rischpater

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting the progress of an asynchronous request

Our request is pretty lightweight but that's not always going to be the case in your application. Moreover, progressing is especially important in mobile web applications, where the mobile device may move in and out of network coverage and suffer temporary network outages. A robust application will test progress status and errors and retry important requests.

The XMLHttpRequest object provides events for it to notify you about the progress of a pending request. These events are as follows:

  • load: This event executes immediately after you open a connection.
  • loadstart: This event executes as a load first starts.
  • progress: This event executes periodically as the load takes place.
  • error: This event executes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required