I almost copy/pasted this example from the Hello.js website:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="js/vendor/hello/hello.js"></script>
</head>
<body>
<script>
hello.init({
facebook : XXXXXXXXXXX, //Plz note that I replaced a correct ID with the XXXXXXXXXX
},{redirect_uri:'redirect.html'});
hello.on('auth.login', function(auth){
// call user information, for the given network
hello( auth.network ).api( '/me' ).then( function(r){
// Inject it into the container
var label = document.getElementById( "profile_"+ auth.network );
if(!label){
label = document.createElement('div');
label.id = "profile_"+auth.network;
document.getElementById('profile').appendChild(label);
}
label.innerHTML = '<img src="'+ r.thumbnail +'" /> Hey '+r.name;
});
});
</script>
<button onclick="hello('facebook').login()">Facebook</button>
</body>
</html>
But when I click the facebook login button the console always shows me this error:
Uncaught TypeError: Cannot read property 'response_type' of undefined
Am I missing something?
Thanks in advance.
You must first register as a Facebook Developer to get an Facebook Developer ID, then you can replace the facebook : XXXXXXXXXXX with your ID. Also you have to specify the return URL. eg.
you can also register yourself as a developer on these networks Windows Live or Google+
EDIT: Added how to register your domain to a the Facebook Website Platform
You must register your domain on Facebook Developer Settings to allow the library to redirect to your domain
Just enter your domain
http://yourDomain
on the "Website URL" field.