Jquery splits huge array into many new callbacks while parsing Jquery splits huge array into many new callbacks while parsing arrays arrays

Jquery splits huge array into many new callbacks while parsing


This sounds like an ASP limiting factor. This is not jQuery specific, but for any JSON response from the ASP server. I've seen this on ColdFusion servers too. Find this setting and see if the limit you have correlates to your limit you hit. See if you can increase it to what you need.

<system.web.extensions>      <scripting>          <webServices>              <jsonSerialization maxJsonLength="x"></jsonSerialization>          </webServices>      </scripting>  </system.web.extensions>

If you don't have access to the server settings, you may also be able to set the value in your code. Here is an MSDN reference for that:

http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.maxjsonlength.aspx

It also states there:

The maximum length of JSON strings. The default is 2097152 characters, which is equivalent to 4 MB of Unicode string data.

This is way over your length of ~7300 characters. But perhaps someone has adjusted this setting.

I also am curious that you see 'multiple' returns to the call back method. Normally, I think, this limit will simply truncate the result of the first callback result.Maybe you also have something else going on?


According to the jQuery documentation, you can set the name of the jsonp callback, to save bytes in your case: jsonpCallback

function J() { ... }$.ajax({    url : url,    cache : false,    dataType : "jsonp",    jsonpCallback : "J",    crossDomain : true,    success : function(root) {        console.log(root)    }})