json.stringify output is 1023 character…why ?

孤街醉人 提交于 2019-12-01 04:59:10

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/10211620/json-stringify-output-is-1023-character-why

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!