In one of my website I am using $.getJSON(url, function (data)
this is not working if the response data is more that 1000. Any alternate is there?
Just use $.post
Instead of using $.getJSON
This is probably a setting on your server. There is typically a maximum response size. Have you looked in Firebug to see if the response is actually getting to the browser?
There are no size restriction in $.getJSON
. Either you have problem on the server or you have timeout problems. $.getJSON
is just a short form of $.ajax
. Try to use $.ajax
with the timeout
parameter with the local timeout (in milliseconds) for the request (see http://api.jquery.com/jQuery.ajax/ for more information).
If you're using asp.net Web Services there is a maximum size for the response.
Thsi is a GOOD thing. Generally, you should be returning SMALL sized bits of things with AJAX.
However, if you WANT to change this to the max, you could add this under the configuration section of the web.config. This is not recommended, mind you.
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="2147483644"></jsonSerialization>
</webServices>
</scripting>
</system.web.extensions>
A somewhat related SO question: Can I set an unlimited length for maxJsonLength in web.config?