Home > DeveloperSection > Forums > How to get the second data of this JSON in jQuery?
Anurag Sharma
Anurag Sharma

Total Post:40

Points:280
Posted on    November-24-2014 10:02 PM

 JavaScript JQuery  JSON 
Ratings:


 1 Reply(s)
 565  View(s)
Rate this:

Hi Guys

How can I get the second data of this JSON - I am beta. in jQuery?

{"alpha":["I am alpha"],"beta":["I am beta."]}

Thanks



Kamlakar Singh
Kamlakar Singh

Total Post:194

Points:1396
Posted on    November-25-2014 2:03 AM

Step 1: Json parsed,

Step 2 : Declared in another string

Step 3 : And then looped inside each entry

  obj=JSON.parse(data);

  var error_string='';

  $.each(obj, function(entry) {

  error_string+=obj[entry]+'<br/>';

  });

  $('#stage').html(error_string);

  }

And then i got the values that is inside, Now i can able to get the values inside the object even for n numbers.


Don't want to miss updates? Please click the below button!

Follow MindStick