tags:

views:

1333

answers:

1

I am using jquery, JSON, and AJAX for a comment system. I am curious, is there a size limit on what you can send through/store with JSON? Like if a user types a large amount and I send it through JSON is there some sort of maximum limit?

Also can any kind of text be sent through JSON. for example sometime I allow users to use html, will this be ok?

+7  A: 

JSON is similar to other data formats like XML - if you need to transmit more data, you just send more data. There's no inherent size limitation to the overall JSON request itself. Any limitation would be set by the server parsing the JSON request. (For instance, ASP.NET has the "MaxJsonLength" property of the serializer.)

Amber
so technicly, If I wanted to take the WHOLE sourcecode to this whole page, it could be sent as a json object?
jasondavis
Yes, with proper encoding.
x3ro
@jasondavis, Easily.
bdonlan
This page's code is actually only 6.7kb (not counting external resources). That'd easily be done with just about any type of HTTP request.
Amber