JSON API in Javascript
1. Serialize JavaScript object to JSON
var messageObject = { title: 'Hello World!', body: 'It\'s great!' }; var serializedJSON = JSON.stringify( messageObject ); });
2. Parse JSON to Javascript Object
var serializedJSON = '{"title":"Hello World!","body":"It\'s great!"}'; var message = JSON.parse( serializedJSON );
技术改变世界