I have the following API example:
"urls": [
{
"value": "http://twitter.com"
},
{
"value": "http://gplus.to"
},
{
"value": "http://plus.ly"
},
{
"value": "http://glpl.us"
},
{
"value": "http://microsoft.ms/+"
},
{
"value": "https://plus.google.com",
"type": "profile"
},
{
"value": "https://www.googleapis.com/plus/v1/people",
"type": "json"
}
]
How can I use .each() to display each href from the link value in the object?
Also how can I exclude the values with type = profile and type = json?
I’ve tried:
var yourLinks = data.urls;
$.each(yourLinks, function(key, value) {
alert(key + ': ' + value);
});
But the alert just contains object : object.
Or more verbose: