views:

31

answers:

1

The following function works perfectly on our production site

function flickrGetPhotos(){
  $.getJSON("http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=" + flickrApiKey + "&user_id=" + flickrUserId + "&format=json" + "&per_page=" + galeriaSetsPerPage + "&jsoncallback=?", 
  function(data){
    flickrBuildCollection(data.photosets.photoset)
  })
} 

YET, this function does not. It only works on IE8 on our local tests (works fine in every browser both locally and remotely):

function ytGetVideos(){
  jQuery.getJSON("http://gdata.youtube.com/feeds/api/users/" + globalYtUser + "/uploads?v=2&alt=jsonc", 
  function(data){
    buildEmbeddedElem(data.data.items[0].id);
  })
}  

As you can see, the only significant difference between both functions is that one is calling the Flickr API and the other one the gdata.youtube API.

IE complains about line 5113 on jQuery 1.4.2 library, which deals with remote calls. When I change the second function to request data from an API/Server other than GDATA/Google, it stops compaining.

What are your thoughts on these?

+1  A: 

You may need the callback=? parameter in order for your jQuery callback method to fire.

Jason McCreary
Yeah, I have just noticed that and came back here to post the answer. But you were faster. Thank you anyway!