title: How to read a json object in js
body: <p>My controller has a method that is returning string representation of a jsonArray as</p>
  
  <p>jsonArray.toString()</p>
  
  <p>Now following is the ajax method</p>
  
  <pre><code>function loadPropertyFile(url) {
  $.ajax({
      type: "GET",
      url: url, 
      dataType: "text",
      success: function(response){
          var obj = jQuery.parseJSON(response);
          alert(obj);
      }
  });
  </code></pre>
  
  <p>}</p>
  
  <p>Here the variable obj after parsing comes out to be </p>
  
  <pre><code>"[{"portal.home":"Home"},{"displaytag.tracking.id":"Item ID"},{"displaytag.tracking.itemName":"Item Name"},{"displaytag.tracking.itemType":"Type"}]"
  </code></pre>
  
  <p>Now I want to access the values from the keys in js</p>
  
  <p>ie. I want to access the value of key "displaytag.tracking.id"</p>
  
  <p>Problem is when I am doing <strong>console.log(obj[0]["portal.home"]);</strong> It is giving me error <strong>TypeError: obj[0] is undefined</strong></p>
  
  <p>What shall I do ?</p>