So I found a tutorial on Facebook Login Integration at: http://www.excellencemagentoblog.com/facebook-login-integration-website
I followed it step by step and Google Chromes Developer Tools give me an error after clicking Facebook Login
saying:
Uncaught TypeError: object is not a function index.php:53
onclick
The button html is like this:
<a class="btn btn-success" href='#' onclick='login();'>
<i class="icon-facebook"></i>
Facebook Login
</a>
The script is as follows, I really can't tell what is wrong because the function is defined within the script.
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId : ' 163289720517425', // App ID
channelURL : '', // Channel File, not required so leave empty
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : false // parse XFBML
});
};
// logs the user in the application and facebook
function login(){
FB.getLoginStatus(function(r){
if(r.status === 'connected'){
window.location.href = 'php/fbconnect.php';
}else{
FB.login(function(response) {
if(response.authResponse) {
//if (response.perms)
window.location.href = 'php/fbconnect.php';
} else {
// user is not logged in
}
},{scope:'email'}); // which data to access from user profile
}
});
}
// Load the SDK Asynchronously
(function() {
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);
}());
</script>