El siguiente código cambiando el ID de la aplicación casi funciona.
Ahora ya me sale el pop-up de facebook, sin embargo me da un error
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
Código HTML:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script> <p id="fb_connect"><a href="#" id="login">Entrar con facebook
</a></p> <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script> <script type="text/javascript"> FB.init({
appId: '1099xxxxx745209',
status: true,
cookie: true,
xfbml: true
});
$(document).ready(function(){
FB.getLoginStatus(function(response) {
if (response.session) {
FB.api('/me', function (usuario) {
$("#fb_connect").append('
<span id="welcome">Bienvenido
<strong>' + usuario.name + '
</strong> |
<a id="logout" href="#">Cerrar seción
</a></span>');
$("#login").hide();
$("#publish_entrie").load("templates/editor.html");
});
}
});
});
$('#login').click(function (e) {
e.preventDefault();
FB.login(
function(response) {
if (response.session) {
if (response.perms) {
FB.api('/me', function (usuario) {
var fb_pic;
FB.Data.query('SELECT pic FROM user WHERE uid = me()').wait(function (filas) {
fb_pic = filas[0].pic;
$.post(
"fb-register.php",
{
idUser: usuario.id,
name: usuario.name,
link: usuario.link,
pic: fb_pic,
email: usuario.email,
website: usuario.website
}
);
});
$("#fb_connect").append('
<span id="welcome">Bienvenido
<strong>' + usuario.name + '
</strong> |
<a id="logout" href="#">Cerrar seción
</a></span>');
$("#login").hide();
$("#publish_entrie").load("templates/editor.html");
});
}
}
},
{ perms: 'user_website, email' }
);
});
$('#logout').live("click", function(e){
FB.logout(function(){
$("#welcome").hide();
$("#login").show();
$("#publish_entrie").html("");
e.preventDefault();
});
});
Salu2!