i have a varable:
var name = "name";
this will be inside an array of objects i have:
var all = [];
$.each(results, function(i, item){
all.push({
rank: i + 1,
username: item.TopicName,
mentions: item.LastHourCount,
totalcount: item.TotalCount,
urlLg: item.LargeImageUrl,
urlSm: item.SmallImageUrl,
shortname: item.ShortName
});
});
I need to look through the array of objects and find the 'shortname' that matches the variable 'name'. the objects look like this:
Object[
mentions: 21737
rank: 2
shortname: "name"
totalcount: 59330
urlLg: null
urlSm: "http://i.cdn.turner.com/nba/nba/pulse/allstar/2012/img/images-small/howard.png"
username: "lebron james"
],
once i find it set that to a variable: var showThis = all.[];
Inside the each function as it loops through the json file, is probably where to look for the name?