1

I know this propably got answered very often but I still don't get it.

The only information I need is "up" and "down".

I got some JSON API Data and just want to get some specific data from it and just output it via alert().

What I got:

  $.getJSON('URL', function(data) {
    jsonData = data;
  });
  alert(data['items'][0]['up'][0]);

What the JSON looks like:

JSON Data picture

I tried to do this with the help of the mozilla wiki...

Kalim
  • 45
  • 1
  • 1
  • 8
  • Move `alert` inside the callback. Also, `up` is a number, not an array, so you want to omit the `[0]` after `['up']`. – Felix Kling Aug 24 '17 at 18:37

0 Answers0