I am getting a json object from a service which is roughly of size 250 kb. I want to loop through the json object and put the data into a table in my page. I am using jquery to loop through the json object(Using $.each()). I am able to process the json object if tha data is small.
So I want to know if there is a limit to size of json object that can be processed by browser/jquery or am I missing something?
Is there any other way to get the json data in parts and add it dynamically to the page?
Thanks in advance.
I haven’t tried, but 250Kb doesn’t sound too big, I would imagine you’d be fine. In terms of getting the JSON in parts, only you can answer that: it depends on the API you’re calling. For example, if the API takes as arguments a start and end Id, you can just make successive calls to the service, changing the start and end id’s each time.
In terms of an upper limit on the size of a json object, afaik the only limits you’ll face will be due to: 1) the client’s available resources and 2) network latencies. Web pages are now sometimes ~1M in size, so a 250kB object shouldn’t be a problem (a browser typically uses O(100MB)). However obviously the bigger the object, the longer it’ll take to transfer, which may have user/interface implications.