Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-31-2012, 01:50 PM   PM User | #1
hiawatha
New to the CF scene

 
Join Date: Dec 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
hiawatha is an unknown quantity at this point
getting photoset from flickr

hello ppl, I am new in javascript and am trying to get photoset photos from flickr. I am using an example code and I got this:

Code:
!(function(){
    'use strict';
    // Get some photos from Flickr for the demo
    $.ajax({
        url: 'http://api.flickr.com/services/rest/',
        data: {
            format: 'json',
            method: 'flickr.photosets.getPhotos',
            api_key: 'cf2db77743310b887e635de84dd7c27b',
            photoset_id: '72157632359075734+',
            auth_token: '72157632392212764-930065b09397fd45',
            api_sig: 'd94b6924abf1d58bf8ff4f015c8ec042'
        },
	    dataType: 'jsonp',
        jsonp: 'jsoncallback'
    }).done(function (data){
        var gallery = $('#gallery'), url;
        $.each(data.photoset, 
            function (index, photo) {
            url = 'http://farm' + photo.farm + '.static.flickr.com/' + photo.server + '/' + photo.id + '_' + photo.secret;
			var img = $('<img>').prop({'src': url + '_s.jpg', 'title': photo.title});
            var link = $('<a rel="gallery">')
						.append( img )
						.prop('href', url + '_b.jpg')
						.appendTo(gallery);
			// lazy show the photos one by one
			img.on('load', function(e){
				setTimeout( function(){ link.addClass('loaded'); }, 20*index);
			});
        });
		
		// finally, initialize photobox on all retrieved images
		$('#gallery').find('a').photobox({ thumbs:true });
    });
from this website but its not getting any photos, what am I doing wrong? plz help an newb uit thanks and "Happy New Year!!"

p.s. forgot to tell that I am getting this error message:

Source File: http://ajax.googleapis.com/ajax/libs.../jquery.min.js
Line: 2

Last edited by hiawatha; 12-31-2012 at 03:52 PM..
hiawatha is offline   Reply With Quote
Old 12-31-2012, 04:08 PM   PM User | #2
hiawatha
New to the CF scene

 
Join Date: Dec 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
hiawatha is an unknown quantity at this point
dont know what happend with my post.

I used example code from this source to get my photos on the website and it looks like this:
Code:
!(function(){
    'use strict';
    // Get some photos from Flickr for the demo
    $.ajax({
        url: 'http://api.flickr.com/services/rest/',
        data: {
            format: 'json',
            method: 'flickr.photosets.getPhotos',
            api_key: 'cf2db77743310b887e635de84dd7c27b',
            photoset_id: '72157632359075734+',
            auth_token: '72157632392212764-930065b09397fd45',
            api_sig: 'd94b6924abf1d58bf8ff4f015c8ec042'
        },
	    dataType: 'jsonp',
        jsonp: 'jsoncallback'
    }).done(function (data){
        var gallery = $('#gallery'), url;
        $.each(data.photoset, 
            function (index, photo) {
            url = 'http://farm' + photo.farm + '.static.flickr.com/' + photo.server + '/' + photo.id + '_' + photo.secret;
			var img = $('<img>').prop({'src': url + '_s.jpg', 'title': photo.title});
            var link = $('<a rel="gallery">')
						.append( img )
						.prop('href', url + '_b.jpg')
						.appendTo(gallery);
			// lazy show the photos one by one
			img.on('load', function(e){
				setTimeout( function(){ link.addClass('loaded'); }, 20*index);
			});
        });
		
		// finally, initialize photobox on all retrieved images
		$('#gallery').find('a').photobox({ thumbs:true });
    });
but I am not getting anything except this error message:

Error: TypeError: e is undefined
Source File: http://ajax.googleapis.com/ajax/libs.../jquery.min.js
Line: 2


I am new in javascript so am bit confused. What am I doing wrong? this exampe works for flickr.interestingness.getList, but not for my case.
thanks in advance.
hiawatha is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:19 PM.


Advertisement
Log in to turn off these ads.