var jn = {"Bangalore":"India","New York":"USA"};
"." or "[]" can be used to Access JSON values.
alert(jn.Bangalore); //India alert(jn["New York"]); //USA
There is a JS package json.js located at https://github.com/douglascrockford/JSon-js/ which provides several methods for JSON parsing.
<script language=javascript src="/your directory/json.js"></script>
<script language=javascript> var str='{"Bangalore":"India","New York":"USA"}'; var obj=str.parseJSON(); alert(obj.toJSONString()); //{"Bangalore":"India","New York":"USA"} alert(obj.Bangalore); //India </script>
JSON is widely used in AJAX applications.