Showing posts with label JSON formatter. Show all posts
Showing posts with label JSON formatter. Show all posts

Friday, June 15, 2012

JSON Parsing using JQuery

Takes a well-formed JSON string and returns the resulting JavaScript object.
  • version added: 1.4.1 

    usage  -- jQuery.parseJSON( json )

    json  --- The JSON string to parse.
Passing in a malformed JSON string may result in an exception being thrown. For example, the following are all malformed JSON strings:
  • {test: 1} (test does not have double quotes around it).
  • {'test': 1} ('test' is using single quotes instead of double quotes).
Additionally if you pass in nothing, an empty string, null, or undefined, 'null' will be returned from parseJSON. Where the browser provides a native implementation of JSON.parse, jQuery uses it to parse the string. For details on the JSON format, see http://json.org/.

Example:

Parse a JSON string.

var obj = jQuery.parseJSON('{"name":"John"}');
alert( obj.name === "John" );

Tuesday, March 6, 2012

JSONView - Firefox addon

Today i came across a firefox plug-in for viewing JSON Data.
After installing this plug in you can see JSON data formatted and highlighted in browser.
Can download JSON View from below link..
https://addons.mozilla.org/en-US/firefox/addon/jsonview/

Free REST service can try after installing JSON View.
http://api.worldbank.org/countries?format=json