title: How do I receive a JSON file using AJAX and parse it using javascript?
body: <p>I'm trying to parse this very long and complicated JSON that foursquare gives me. This is my AJAX request:</p>
  
  <pre><code>    $.ajax({
        url: 'https://api.foursquare.com/v2/venues/explore',
        dataType: 'json',
        data: 'limit=7&amp;ll='+latitude+','+longitude+'&amp;client_id='+client_id+'&amp;client_secret='+client_secret+'',
        async: false,
        success: getVenues(data)
  });
  </code></pre>
  
  <p>getVenues is a function I'm making to sort through the JSON and display relevant stuff on the page. The first problem I'm having is that I don't know how to tell the success function that it should deal with the data received from the server - is this data stored in a variable somewhere? I'm currently doing getVenues(data) but it's telling me that 'data' is not a defined variable. Many online tutorials, however, seem to be happy with just doing a function to this mystical 'data' and theirs seem to work.</p>
  
  <p>Next, I'm having trouble parsing the JSON itself. Here is a shortened version of the JSON I'm trying to deal with: <a href="http://pastie.org/4382619" rel="nofollow">http://pastie.org/4382619</a>. How do I select the venue names and ID's etc and show them on the page?</p>
  
  <p>Thanks</p>