0
我已经使用图表API来获取相册,我将所有相册都放到了我的网站中,但当刷新页面时相册的位置发生了变化。为什么会发生?将facebook相册嵌入网站
我在这里附上我的脚本。
<script>
$(document).ready(function() {
var albumIdsUrl = "https://graph.facebook.com/<myname>/albums?callback=?";
$.getJSON(albumIdsUrl, function(data) {
var len = data.data.length;
for(var i=0;i<len;i++){
var aid = data.data[i].id;
getAlbumCoverPhoto(data.data[i].cover_photo, data.data[i].id, data.data[i].name, data.data[i].count);
}
});
});
function getAlbumCoverPhoto(coverPhoto, albumId, albumName, count) {
var coverPhotoUrl = "https://graph.facebook.com/" + coverPhoto + "?callback=?";
$.getJSON(coverPhotoUrl, function(coverPhotoData) {
if(typeof(coverPhotoData.picture)!="undefined"){
htmlData = '<li><figure><a class="imageLink" href="fb_album_photos.html?id='+ albumId + '"><img src="' + coverPhotoData.picture + '" /></a></figure><figcaption>'+albumName+'</br>'+count+' Photos</figcaption></li>';
$('#FBalbum').append(htmlData);
}
});
}
</script>
感谢您的快速反应。我试过上面的代码,并得到同样的问题 – user1606656 2012-08-17 13:49:37
我在我的答案编辑排序功能,结果似乎比我有更多的一致。 – Oxin 2012-08-17 13:55:08