Say we have an ajax call to a server as such :
1 var jSonCall =
2 $.ajax({
3 url: 'http://some_url.com/some_endpoint'
4 }).success(function(response) {
5 $(response).appendTo($('.some_div'));
6 });
7 return jSonCall;
And in chrome I get an "Uncaught SyntaxError: Unexpected identifier" in the linked jquery file, supposedly caused by line 4.
Say also that I check the response from the request in the Chrome's network tab and discover that the response was 18,000 lines of html (*edit: +150,000 characters). Is it possible that the parameter 'response' (jquery object that should be the bookoos of html), has truncated this somewhere, and that it can only can hold so much html? If so, does anyone know what the hard limitation is (maximum characters or so)?
You have an extra }
var jSonCall =
$.ajax({
url: 'http://some_url.com/some_endpoint'
}).success(function(response) {
$(response).appendTo($('.some_div'));
});
return jSonCall;
Edit : try :
var jSonCall =
$.ajax({
url: 'http://some_url.com/some_endpoint'
}).success(function(response) {
$('.some_div').html(response); //don't make jquery parse the html
});
return jSonCall;
this way you don't have to worry about jQuery parsing the response's html first ($(response)
).
It depends of the JavaScript VM, but in general, there is no hard limit, and the maximum length of a string is defined by the available JSVM heap.