Converting JSON objects to string
myJson=[{"test1":1, "test2":2}];

strJson=XSP.serialize(myJson)
// strJson >>> "[{\"test1\":1,\"test2\":2}]"

restoredJson=XSP.fromDojo(strJson)





XPages alternative for JSON.stringify() and JSON.parse() functions

JavaScript (Client)
Serdar Basegmez
Rating
11

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.







No comments yetLogin first to comment...