I have this function where I am getting the name of a Venue:
var VenueNames = [];
var TipPlaceName = [];
var Tip = [];
function jsonData(){
$.ajax({
url: url,
cache: false,
dataType: 'jsonp',
success: function(results) {
for(var i = 0; i < results.response.checkins.items.length; i++) {
var name = results.response.checkins.items[i].venue.name;
VenueNames.push(name);
}
}
});
};
here is my other function, which gives me “Tips” the user left along with the name of the Venue the “Tips” where left at.
function tips(){
$.ajax({
url: urltips,
cache: false,
dataType: 'jsonp',
success: function(results) {
for(var i = 0; i < results.response.tips.items.length; i++) {
var tip = results.response.tips.items[i].text;
var tipVenueName = results.response.tips.items[i].venue.name;
Tip.push(tip);
TipPlaceName.push(tipVenueName);
}
}
});
};
I need to match up the venue names from the first function and if they match, use the tips that are associated with the matching Venue.
Why not try using an object instead?