JQuery & Flickr API, not getting photoset details correctly

I amy trying to use the Flickr API to create a photo gallery on my website, I have the API & photoset, and am using the Flickr method 'getPhotos' which returns the photos from a given Set and I am calling this using jQuery. My javascript all seems to be working fine except whilst the details of the Flickr photoset are being returned, at the point of building my src locations, the data is being lost... Whilst debugging (using Internet Explorer - F12) the object 'data' contains the expected details, with a parameter of photoset, within that parameter I have the parameter 'photo' and within that I have a collection of objects [0-37] each containing the parameters 'farm, id, secret, server & title' all with the expected values. Yet when I build my HTML var 'theHtml' and fill the gaps with the above values, my HTML value is set to 'undefined'. So instead of getting the expected: farm4.static.flickr.com/2480/1234567890_a1a1a1a1a1_b.jpg I get farmundefined.static.flickr.com/undefined/undefined_undefined_b.jpg Can anyone explain this to me? Here is my jQuery code:
var source isn't being built corerctly. Cheers in advance!
Sorted! $.each(data.photoset, function(i,photo){ Should have been $.each(data.photoset.photo, function(i,photo){

以上就是JQuery & Flickr API, not getting photoset details correctly的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准