i'm trying to implement a Facebook login procedure and it's not working. I have a POST to AJAX that seems to be interpreting a returned TRUE incorrectly. And although I've put logs throughout to track the logic flow.. it doesn't seem to be flowing like I expect it. Can you see the problem?

initUserFacebookConnect
returned false from AJAX post // << this seems to come too early!
// console.log(data) doesn't log anything .. why?
you are NOT a FB member
checking checkFBmember 657322189
Inside model and checking
Inside model and FOUND member
FB id found in system

So I am posting to ajax .. I am hitting my model and returning TRUE to my controller which returns TRUE back to initUserFbConnect .. but somehow that POST method receiving FALSE? More than that.. it skips right ahead and shows me "returned false" before any of my other methods fire?

I'm confused why I'm returning FALSE since I'm finding the member in the DB.. but I'm also confused of the order that my logging is firing. I expect the IF statement in initUserFbConnect to resolve after everything else has returned to it. But it seems to be jumping the gun. It has to go through the PHP and DB check first to even know that it has received a TRUE/FALSE, right?

Ok.. I didn't realize that JS wouldn't interpret true/false. I will echo instead. Thanks for the help! But still.. shouldn't the other logs fire before "returned FALSE from AJAX post"? Doesnt it need to go through all the other stuff before it knows what it has got back in the first place? ( edit - I've echoed now.. and it works.. but I still have the weird logging order)
–
K.K. SmithJan 11 '13 at 17:17