I have this facebook js api code and it was working till a day back …
and now it has suddenly stopped working ..
im using it for a collage project and its possible my partner may have fiddled with it but i cant seem to find anything wrong with it …
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript" >
var access_token;
FB.init({
appId:'XYZ',
cookie:true,
status:true,
xfbml:true
});
FB.Event.subscribe('auth.login', function(response) {
login_event();
});
function login_event(){
FB.api("/me",function(user){
var request = new XMLHttpRequest();
request.onreadystatechange=function(){
uid = user.id;
if(request.readyState==4 && request.status==200){
$("#middle").load("login_manager.php?uid="+uid);
}
}
request.open("GET", "sessions.php?uid="+uid, true);
request.send();
})
}
if(navigator.appCodeName=="Mozilla"){
FB.getLoginStatus(function(response) {
document.getElementById("middle").innerHTML = "<img src=\"../images/loading-round2.gif\">";
if (response.session) {
access_token = response.session.access_token;
FB.api('/me', function(user) {
if (user!=null) {
var uid = user.id;
var request = new XMLHttpRequest();
request.open("GET", "sessions.php?uid="+uid, true);
request.send();
request.onreadystatechange=function(){
if(request.readyState==4 && request.status==200){
$("#middle").load("login_manager.php");
}
}
}
});
}
else{
document.getElementById("middle").innerHTML = '<fb:login-button perms="email,user_checkins,offline_access,publish_stream">Login with Facebook</fb:login-button>';
FB.XFBML.parse(document.getElementById('middle'));
}
});
}
</script>
it does’nt seem to be entering the getLoginStatus() function
It has started working again ..
It was a problem at facebook’s end