Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  23] [ 2]  / answers: 1 / hits: 127389  / 14 Years ago, mon, july 26, 2010, 12:00:00

Is there a quick function to convert JSON objects received via jQuery getJSON to a string variable dump (for tracing/debugging purposes)?


More From » jquery

 Answers
8

Yes, JSON.stringify, can be found here, it's included in Firefox 3.5.4 and above.



A JSON stringifier goes in the opposite direction, converting JavaScript data structures into JSON text. JSON does not support cyclic data structures, so be careful to not give cyclical structures to the JSON stringifier. https://web.archive.org/web/20100611210643/http://www.json.org/js.html



var myJSONText = JSON.stringify(myObject, replacer);

[#96108] Friday, July 23, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
devlin

Total Points: 474
Total Questions: 113
Total Answers: 100

Location: Sweden
Member since Fri, Apr 16, 2021
3 Years ago
devlin questions
Tue, Apr 27, 21, 00:00, 3 Years ago
Sat, Oct 31, 20, 00:00, 4 Years ago
Fri, Aug 28, 20, 00:00, 4 Years ago
;