Edit:
On further investigation, it looks like the Juicebox-Pro API method getImageInfo() returns the thumbURL successfully (but not the imageURL) so you should be able to extract the Flickr photoId from the thumbURL as follows. This avoids the need for any delay at all.jb.onImageChange = function(e) { // Get image info for current image var info = jb.getImageInfo(e.id); // Get thumbURL for current image var src = info.thumbURL; // Extract Flickr photoId from thumbURL var id = src.substring(src.lastIndexOf('/') + 1, src.indexOf('_')); // Fetch tags of currently-displayed image using Flickr API flickr.tags.getListPhoto method // Enter your own Flickr API Key in the line below $.getJSON('https://api.flickr.com/services/rest/?method=flickr.tags.getListPhoto&api_key={your_flickr_api_key}&photo_id=' + id + '&format=json&jsoncallback=?', function(json) { // Initialize tags array var tags = []; // Iterate over all tags $.each(json.photo.tags.tag, function(i, data) { // Add new tag to array tags.push(data.raw); }); // Display tags array in output container $("#output").html('<p>Tags: ' + (tags.length > 0 ? tags : 'None') + '</p>'); }).fail(function() { // Fail message $("#output").html('<p>Cannot find tags.</p>'); }); };
I have logged a bug report with the developers regarding the inability to fetch the imageURL from the getImageInfo() method when using Flickr as a source of images.
Steven,
This works beautifully and is ultimately the best solution for me. I am glad you were able to help me find it.
Just so you know, you alone have been worth double or triple the price of JuiceBox :)
Thanks,
John