Link to home
Start Free TrialLog in
Avatar of cgray1223
cgray1223

asked on

Facebook Connect Javascript API

Hello,

I'm trying to use the Facebook Connect Javascript api to login a user to my website.  I've read the documentation and I'm a bit lost.  I can get the facebook connect button to appear and to login, but I can't get it to do the below.

-after logging in I need to call a javascript function in my application so that I can update my database.  Is there maybe a way to redirect to html page after successfully logging in with facebook connect?

Thanks for the help.
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cgray1223
cgray1223

ASKER

Thanks leakim971, you're example works!  One thing I did notice is the response.uid is undefined when I'm connected.  Any ideas?


 function javascriptFunctionInMyApplicationSoThatICanUpdateMyDatabase(response) {
	    	  alert("db funct: " + response.uid);
	    	  
	  	}

Open in new window

Also, when I'm not connect (remove the app from my facebook account) and I'm logged into Facebook, the below doesn't run, should it?  Thanks for the help!


FB.logout(function(response) {
                  alert("You're not connected!");
            });
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the points!