0

i am trying to redirect the user to a different page after a successful login.

i have this code:

<div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({ appId:'11898121834', cookie:true, status:true, xfbml:true }); FB.Event.subscribe('auth.login', function () { window.location = "facebook_login.php"; //alert ("hello"); }); </script> <fb:login-button perms="email,user_checkins" >Login with Facebook</fb:login-button> 

this wont work. the page refreshes but to the same page.

any ideas? Thanks

1 Answer 1

1

insert the new page you want to redirect to in the href attribute

FB.Event.subscribe('auth.login', function () { window.location.href = "http://example.com/newpage"; }); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.