How to get the facebook details using id?

Hello guys,

Today I gonna explain you how to get Facebook user’s basic detail using user id. bellow function useful when you are developing authentication system of your site using facebook so there you need basic detail of your visitor.

 

function getUserInfo(id)
{
     $.ajax({
	type: "GET",
	url: "https://graph.facebook.com/"+id,
	contentType: "application/json; charset=utf-8",
	dataType: "json",
	success: function(data) {
	   alert(data.name);
	 }
	});
}

That’s it.. isn’t it simple… šŸ™‚

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s