Loading ...
Sorry, an error occurred while loading the content.

713Re: [json] Iterating through a huge JSON variable - freezes FF

Expand Messages
  • mertsakarya@hotmail.com
    Feb 7, 2007
      Once 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.

      Mert


      ----- Original Message -----
      From: carl.harroch
      To: json@yahoogroups.com
      Sent: Wednesday, February 07, 2007 2:07 PM
      Subject: [json] Iterating through a huge JSON variable - freezes FF


      Hello,

      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.

      Any ideas?

      /Carl





      [Non-text portions of this message have been removed]
    • Show all 10 messages in this topic