JSON decoder and encoder.
Converts an object or array to a JSON string.
var myJSON = JSON.encode(obj);
var fruitsJSON = JSON.encode({apple: 'red', lemon: 'yellow'}); // returns: '{"apple":"red","lemon":"yellow"}'
Converts a JSON string into a JavaScript object.
var object = JSON.decode(string[, secure]);
var myObject = JSON.decode('{"apple":"red","lemon":"yellow"}'); // returns: {apple: 'red', lemon: 'yellow'}
© Linux.ria.ua, 2008-2024 |