Today I am going to tell how to get facebook cover page image using jQuery code.
By using FB username, You will get user’s cover page image easily with jQuery Ajax jQuery.getJSON()
This method will Load JSON-encoded data from the server using a GET HTTP request.
jQuery Code to fetch Facebook Cover Page
jQuery.getJSON('http://graph.facebook.com/'+username+'?fields=cover&callback=?', function(data){
if(data.cover) {
jQuery('#cover-page').html('<img src="'+ data.cover.source + '">');
} else if(data.error) {
alert(data.error.message);
} else {
alert('No Cover Page Found');
}
});
Please don’t forget to share and subscribe to latest updates of the blog. Also any comments and feedback are all welcome!
Thanks!
This realy intersting!
You think this solve with profile page?
So I start tyeping my friend or page name and this turn to facebook profile link, and when I mouseOver for link, this sow my friend cover?