Is there a limit on size of json object that can be processed by browsers?

前端 未结 2 1838
花落未央
花落未央 2021-01-20 15:45

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

相关标签:
2条回答
  • 2021-01-20 15:59

    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.

    0 讨论(0)
  • 2021-01-20 16:09

    I think not. 250 kb is not very big. You can get json data sequentially. Take a lopk at youtube or twitter. Both of those services have "More" button to load extra data.

    0 讨论(0)
提交回复
热议问题