the compact javascript framework
in partnership with mediatemple
Simple Json parser and Stringyfier, See: http://www.json.org/
MIT-style license.
Json.js | Simple Json parser and Stringyfier, See: http://www.json.org/ |
Json | Simple Json parser and Stringyfier, See: http://www.json.org/ |
Properties | |
toString | Converts an object to a string, to be passed in server-side scripts as a parameter. |
evaluate | converts a json string to an javascript Object. |
Simple Json parser and Stringyfier, See: http://www.json.org/
Properties | |
toString | Converts an object to a string, to be passed in server-side scripts as a parameter. |
evaluate | converts a json string to an javascript Object. |
Converts an object to a string, to be passed in server-side scripts as a parameter. Although its not normal usage for this class, this method can also be used to convert functions and arrays to strings.
obj | the object to convert to string |
A json string
Json.toString({apple: 'red', lemon: 'yellow'}); '{"apple":"red","lemon":"yellow"}'
converts a json string to an javascript Object.
str | the string to evaluate. if its not a string, it returns false. |
secure | optionally, performs syntax check on json string. Defaults to false. |
Json test regexp is by Douglas Crockford http://crockford.org.
var myObject = Json.evaluate('{"apple":"red","lemon":"yellow"}'); //myObject will become {apple: 'red', lemon: 'yellow'}
Documentation by Aaron Newton & Mootools Developers, generated by NaturalDocs and GeSHi