A natural fit for the JSON Utility is working with the Connection Manager. In this example, we'll request JSON data from the server using Connection Manager's
asyncRequest and parse the resulting JSON string data for processing.
Click the Get Messages button to send the request to the server.
YAHOO.lang.JSON.parsein the success handler
Pass the XHR
YAHOO.lang.JSON.parse and capture the return value. Note that the parse method can throw a
SyntaxError exception, so be sure to wrap the call in a
asyncRequest. In this case, the data is an array of object literals in this form: