Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
734 views
in Technique[技术] by (71.8m points)

limit - json.stringify output is 1023 character...why ?

i have a little big problem, my javascript object is too long, but it is ok. at the moment i use .stringify() function for convert my object in a json string, the string is truncated with "..." and the lenght is 1023.

why ? AND how change this limit ?

im sorry for my english.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The RFC for JSON parsers (see http://www.ietf.org/rfc/rfc4627.txt section 4) says, each implementation may choose to limit the length and content of strings. So depending on which browser / version you are using at the moment, you may be hitting the limit.

One portable alternative would be to look at json2. The JS source is found at https://github.com/douglascrockford/JSON-js/blob/master/json2.js -- you could use this as-is, or alter it to deal with the length / type of data that's causing your problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...