Tuesday, April 15, 2014

JSON.stringify(whatever);

...is a way in JavaScript to cast JSON back to a string. Observe:

var item = { Diameter: '13', Distance: '3.14' };
SolorSystemCallBackPanel.PerformCallback(JSON.stringify(item));

 
 

The string that would get made in this case would have this in it:

"{\"Diameter\":\"13\",\"Distance\":\"3.14\"}"

No comments:

Post a Comment