**my problem is that i am able to logged in with facebook what unable to get the user details my code is below.. i have one more question in site_url(facebook apps) the url should be the redirect uri? **
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: ******* , status: true, cookie: true,
xfbml: true});
FB.Canvas.setAutoResize();
FB.getLoginStatus(function(response) {
if (response.session) {
FB.api( /me , function(response) {
$( #name ).val(response.first_name);
});
} else {
// no user session available, someone you dont know
}
});
};
(function() enter code here{
var e = document.createElement( script ); e.async = true;
e.src = document.location.protocol +
//connect.facebook.net/en_US/all.js ;
document.getElementById( fb-root ).appendChild(e);
}());
function fblogin() {
FB.login(function(response) {
if (response.session) {
if (response.perms) {
// user is logged in and granted some permissions.
// perms is a comma separated list of granted permissions
} else {
// user is logged in, but did not grant any permissions
}
} else {
// user is not logged in
}
}, {perms: read_stream,publish_stream,offline_access });
};