I\'m trying to extract the image post URLs from a subreddit feed, and render elements on my page.
Been trying to hack together the .ge
You are using the wrong url. Use this:
$.getJSON("http://www.reddit.com/r/pics/.json?jsonp=?", function(data) {
// Do whatever you want with it..
});
EDIT : Working example based on your fiddle in the comments.
$.getJSON("http://www.reddit.com/r/pics/.json?jsonp=?", function(data) {
$.each(data.data.children, function(i,item){
$("<img/>").attr("src", item.data.url).appendTo("#images");
});
});
You should use data.data.children
and not data.children