是否有可以通过浏览器来处理JSON对象的大小限制? [英] Is there a limit on size of json object that can be processed by browsers?
问题描述
我收到的是大约大小250 KB服务的JSON对象。我想通过JSON对象环路,并把数据放入一个表在我的网页。我通过JSON对象使用jQuery循环(使用$每个())。我能够处理JSON对象,如果塔的数据很小。 所以,我想知道是否有限制JSON对象的大小,可以通过浏览器/ jQuery的处理还是我失去了一些东西?
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?
是否有任何其他方式获得的部分JSON数据,并动态地添加到页面?
Is there any other way to get the json data in parts and add it dynamically to the page?
在此先感谢。
推荐答案
我还没有尝试过,但250KB听起来并不太大,我会想象你会被罚款。在获得零件的JSON而言,只有你能回答这个问题:这取决于你正在调用API。例如,如果API作为参数开始和结束编号,你可以做连续调用服务,开始和结束ID的每次改变。
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.
在上一个JSON对象的大小上限而言,AFAIK你将面临的将是由于唯一的限制:1)客户端的可用资源; 2)网络延迟。网页是现在有时〜1M的大小,所以一个250KB的对象不应该是一个问题(浏览器通常使用O(100MB))。但是显然更大的物体,时间越长,将采取转移,这可能具有用户/接口问题。
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.
这篇关于是否有可以通过浏览器来处理JSON对象的大小限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!