// gestione facebook function ajax(urlReq, functionSuccess) { jQuery.support.cors = true; jQuery.ajax({ url: urlReq, dataType: 'text', success: function (data) { functionSuccess(data); }, error: function (xhr, status, error) { var err = eval("(" + xhr.responseText + ")"); alert("jQuery error: " + error); } }); } window.fbAsyncInit = function () { FB.init({ appId : '264593510632665', version : 'v2.8', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true, // parse XFBML oauth : true }); var at = "264593510632665|GhFGlUOVavwy_G80NZwIE4kUitE"; var rid = "1442513252487032"; var albumURI = "https://graph.facebook.com/" + rid + "/photos?access_token=" + at + "&fields=created_time,name,images,link&limit=3"; ajax(albumURI, function(data){ var obj = JSON.parse(data); data = obj.data; populateFbWrapBlock(data) }); };