title: How to extract url data from Reddit API using JSON
body: <p>I'm trying to extract the image post URLs from a subreddit feed, and render <code>&lt;img&gt;</code> elements on my page.</p>
  
  <p>Been trying to hack together the <code>.getJSON()</code> <a href="http://api.jquery.com/jQuery.getJSON/#example-0" rel="nofollow noreferrer">Flickr example</a> from the jQuery Docs for a while now and I'm not getting anywhere. </p>
  
  <p>Code in question:</p>
  
  <pre><code>$.getJSON('http://www.reddit.com/r/pics.json', function (data) {
    $.each(data.children, function (i, item) {
      $('&lt;img/&gt;').attr("src", url).appendTo("#images");
    });
  });
  </code></pre>
  
  <p>In the body, I have the element: <code>div#images</code></p>
  
  <p>I understand that I need to use JSONP, but not sure how. Can somebody point me in the right direction?</p>