Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.btn').click(function() {
- $('.text').html('loading...');
- $.ajax({
- type: 'GET',
- url: 'http://www.reddit.com/r/aww/search.json?q=puppy&restrict_sr=true',
- success: function(data) {
- $('.text').html('');
- puppyObjects = data.data.children;
- for (var i = 0; i < puppyObjects.length; i++) {
- var img = '<img src="' + puppyObjects[i].data.thumbnail + '" />';
- $('.text').append(img);
- }
- },
- });
- });
Add Comment
Please, Sign In to add comment