HOW TO GET THE SECOND DATA OF THIS JSON IN JQUERY?

Anurag Sharma

Total Post:40

Points:280
Posted by  Anurag Sharma
JQuery  JSON 
 909  View(s)
Ratings:
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

  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: How to get the second data of this JSON in jQuery?

    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.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!