I am currently integrating the Foursquare API into a web application, and while I have successfully made the API call and retrieved the results, I am facing challenges in parsing the data as per my requirements. I prefer not to use third-party parsers as they tend to confuse me. What I aim for is to display a list of clickable venue names sorted by distance, with each click assigning the latitude and longitude values of the selected venue to a variable.
$(document).ready(function(){
$.getJSON("https://api.foursquare.com/v2/venues/search?ll=-27.58818,-48.523248&
client_id=9&client_secret=9&v=20111107",
function(data){
//code here
});
});
The JSON results are structured as follows:
{"meta":
{"code":200},
"response":
{"venues":
[{"id":"4c158143a1010f47a1364e18",
"name":"Parma Pizza",
"contact":{"phone":"+554832346363","formattedPhone":"+55 48 3234-6363"},
"location":{"address":"R. Lauro Linhares, 1052",
"lat":-27.588341,
"lng":48.5232834,
"distance":18,
Despite numerous attempts using third-party libraries like Jackson, alerting out names, and document.write, along with an unsuccessful .$each remover method, I have hit a roadblock. Any assistance would be greatly appreciated.