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.
JavaScriptHTMLWeb Development

Avatar of undefined
Last Comment
leakim971

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
leakim971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
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

cgray1223

ASKER
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
leakim971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
leakim971

Thanks for the points!
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes