We help IT Professionals succeed at work.

Facebook Connect Javascript API

629 Views
Last Modified: 2012-05-11
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.
Comment
Watch Question

Multitechnician
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
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

Author

Commented:
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!");
            });
leakim971Multitechnician
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
leakim971Multitechnician
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Thanks for the points!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.