/*
* Flickr Album
* http://ifiona2012.blogspot.com/
*
* Dual licensed under the MIT or GPL Version 2 licenses.
* Email: [email protected]
*
*/
function FlickrUtil() {
"use strict";
}
(function() {
"use strict";
// Flickr rest service address
FlickrUtil.prototype.DOMAIN = "http://api.flickr.com/services/rest/";
/*
* Cross-domain ajax request.
*
* @param url AJAX request URL.
* @param successCallback AJAX success callback function.
*/
var ajax = function( url, successCallback ) {
$.ajax({
url : url,
type : "GET",
dataType : "jsonp", // JSONP cross-domain request
crossDomain : true,
async : true,
cache : true,
jsonp : "jsoncallback", // Callback function is called 'jsoncallback'.
success : successCallback
});
};
/*
* Append query string to the GET URL.
*
* @param params An object of parameters to serialize
* @param url URL appended to.
*/
var appendQuery = function( params, url ) {
var // Serialize params object into a URL query string
p = $.param(params),
s;
url = url || FlickrUtil.prototype.DOMAIN;
s = url.indexOf('?') < 0 ? "?" : "&";
return url + s + p;
};
/*
* Get a list of public photos for the given user.
*
* @param userId The NSID of the user who's photos to return.
* @param apiKey Flickr API application key. See http://www.flickr.com/services/api/misc.api_keys.html for more details.
* @param perPage Number of photos to return per page.
* @param page The page of results to return.
* @param successCallback AJAX success callback function.
*/
FlickrUtil.prototype.getPublicPhotos = function( userId, apiKey, perPage, page, successCallback ) {
var method =...
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.