var jsonData = {"success":true,
"data":[{"id":8,"name":"carrot"}],
"count":1};
var sourceVar = $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?",
function(data){
//start object looping
for(var prop in data) {
//only get current object property
if(data.hasOwnProperty(prop)){
if(typeof data[prop] !== 'object'){
$('<p>property is: '+ prop+' with value ='+data[prop]+'</p><br />').appendTo('#result');
}else{
for(var innerObj in data[prop]){
$('<p>property is: '+ innerObj +' with value ='+data[prop][innerObj]+'</p><br />').appendTo('#result');
}
}
}//end this object property
}//end object looping
$.each(data.items, function(i,item){
$("<img/>").attr("src", item.media.m).appendTo("#images");
if ( i == 3 ) return false;
});
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.