user202411
user202411

Reputation: 202

jQuery + Google API + IE8 error

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?

Upvotes: 1

Views: 692

Answers (1)

Jason McCreary
Jason McCreary

Reputation: 72961

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

Upvotes: 2

Related Questions