1

I have some json coming back and each chunk is around 200 rows. The format is something like this

{ "data": [

    {"time":24, "col1":54, "col2":23}
    {"time":56, "col1":65, "col2":22}
    ...
]}

Since the results are streamed to me a chunk at a time, it would be really nice to start graphing as I receive the data. Another option is the csv download as well which also gives us 200 rows in each chunk. Is there any way to setup java script so I can do the one ajax request and my code will be called for each chunk of data so I can add it to my chart while waiting for the next piece of data?

thanks, Dean

Dean Hiller
  • 19,235
  • 25
  • 129
  • 212
  • this should help: http://stackoverflow.com/questions/10753725/jquery-support-transfer-encodingchunked-how – Tasos Bitsios May 07 '13 at 22:42
  • 1
    the json is a no-go until it all arrives. you might be able to accumulate the CSV rows using a partial responseText property. – dandavis May 07 '13 at 22:42
  • Can you just paginate the data into multiple requests? – Jivings May 07 '13 at 22:49
  • Have a look at this http://www.kylescholz.com/blog/2010/01/progressive_xmlhttprequest_1.html and http://friendlybit.com/js/partial-xmlhttprequest-responses/ – plalx May 07 '13 at 22:58

0 Answers0