Both your template and a "Find us on Facebook" module are including the older Facebook Javascript library which will prevent JFBConnect, which is using the latest version of the Javascript library, from working. You'll need to disable the older Javascript inclusions to get things working.Test: Facebook Javascript library inclusion
Fail: Another Facebook extension is installed, including the Facebook Javascript library, and may conflict.
Test: Facebook Javascript library inclusion
Fail: Another Facebook extension is installed, including the Facebook Javascript library, and may conflict.
<script type="text/javascript">
//<![CDATA[
window.fbAsyncInit = function() {
FB.init({ appId: '',
status: true,
cookie: true,
xfbml: true,
oauth: true
});
function updateButton(response) {
var button = document.getElementById('fb-auth');
if(button) {
if (response.authResponse) {
// user is already logged in and connected
button.onclick = function() {
if(jQuery('#login-form').length > 0){
jQuery('#modlgn-username').val('Facebook');
jQuery('#modlgn-passwd').val('Facebook');
jQuery('#login-form').submit();
} else if(jQuery('com-login-form').length > 0) {
jQuery('#username').val('Facebook');
jQuery('#password').val('Facebook');
jQuery('#com-login-form').submit();
}
}
} else {
//user is not connected to your app or logged out
button.onclick = function() {
FB.login(function(response) {
if (response.authResponse) {
if(jQuery('#login-form').length > 0){
jQuery('#modlgn-username').val('Facebook');
jQuery('#modlgn-passwd').val('Facebook');
jQuery('#login-form').submit();
} else if(jQuery('#com-login-form').length > 0) {
jQuery('#username').val('Facebook');
jQuery('#password').val('Facebook');
jQuery('#com-login-form').submit();
}
} else {
//user cancelled login or did not grant authorization
}
}, {scope:'email'});
}
}
}
}
// run once with current status and whenever the status changes
FB.getLoginStatus(updateButton);
FB.Event.subscribe('auth.statusChange', updateButton);
};
//
jQuery(window).load(function() {
(function(){
if(!document.getElementById('fb-root')) {
var root = document.createElement('div');
root.id = 'fb-root';
document.getElementById('gkfb-root').appendChild(root);
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}
}());
});
//]]>
</script>
Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.