1 Class: Request.JSON {#Request-JSON}
2 =================================
4 Wrapped Request with automated sending and receiving of JavaScript Objects in JSON Format.
8 [Request](/Request/Request)
12 var myJSONRemote = new Request.JSON([options]);
16 1. options - (*object*, optional) See below.
20 * secure - (*boolean*: defaults to true) If set to true, a syntax check will be done on the result JSON (see [JSON.decode](/Utilities/JSON#JSON:decode)).
26 Fired when the request completes. This overrides the signature of the Request success event.
30 onSuccess(responseJSON, responseText)
34 1. responseJSON - (*object*) The JSON response object from the remote request.
35 2. responseText - (*string*) The JSON response as string.
39 * (*object*) A new Request.JSON instance.
43 // this code will send a data object via a GET request and alert the retrieved data.
44 var jsonRequest = new Request.JSON({url: 'http://site.com/tellMeAge.php', onSuccess: function(person){
45 alert(person.age); // alerts "25 years".
46 alert(person.height); // alerts "170 cm".
47 alert(person.weight); // alerts "120 kg".
48 }}).get({'firstName': 'John', 'lastName': 'Doe'});