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