Hayk Saakian
Hayk Saakian

Reputation: 2036

measure download progress of large json in javascript w/ jquery

Is there any way to measure and keep track of the progress of downloading a large JSON file using getJSON, or something similar if that can't do it. at the moment, since getJSON has basically only a success callback, i don't know what's going on until the json is done downloading. (upwards of a minute)

if it helps, this will be part of a standalone chrome app and a phonegap app

Upvotes: 1

Views: 558

Answers (1)

Hayk Saakian
Hayk Saakian

Reputation: 2036

I ended up following a guide at https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest and using XMLHTTPRequests instead of getJSON

I also had to use some rack middleware on the ruby on rails side to include content-length in the HTTP response for JSON

Upvotes: 1

Related Questions