Thursday, July 4, 2013

Convert Javascript object to string ( json string )

var objPerson = {};
objPerson.Names = 'Chill';
objPerson.CarNo = [1, 2, 3]
var jsonResultText = JSON.stringify(objPerson, null, 2);
jsonResultText;
-------------------
The above will produce the below json string as output

No comments:

Post a Comment