713Re: [json] Iterating through a huge JSON variable - freezes FF
- Feb 7, 2007Once we've had long running script on the client-side, which took about 1 minutes to execute/parse/display the data(a two dimensional array with thousands of rows).
First of all, this shouldn't happen, but if you can't avoid it, do it asychronously.
What we did was, we created an "interval", and parsed them by the hundreds (less or more for your situation) each time.
This increased responsiveness of the page.
The idea is; use asynchronousity while downloading the data and if the data is huge, use asynchronousity again to parse/display the data.
----- Original Message -----
Sent: Wednesday, February 07, 2007 2:07 PM
Subject: [json] Iterating through a huge JSON variable - freezes FF
I am trying to iterate through a big JSON variable (about 1500 nodes).
It works but FF pops up with the message saying the script is not
responding (A script on this page may be busy... do you want to stop
the script, debug, continue). If I select continue, it works fine. It
is just that the iteration takes a bit of time to go through all the
nodes. Is there a way to avoid the above? I searched a bit the net and
it is not very clear how to do so as JS is not multithreaded from what
I could gather. However, I am sure, there could be some asynchron
iteration releasing the cpu from time to time to ensure nothing else
needs to be done on the page.
[Non-text portions of this message have been removed]
- << Previous post in topic Next post in topic >>