I want to change the registration and registration input stream using the FB Javascript SDK using FB.login ().
Now the FBML method works fine:
<fb:login-button registration-url="<?php echo $config["base_url"]; ?>test.php" size="small"></fb:login-button>
when you click the button above the following code, a div is launched to show the registration plugin
FB.getLoginStatus(function(response) { if (response.status === 'not_authorized') { // show registration form document.getElementById('reg').style.display = "block"; } }); // registration form placed in a div <div style="display:none;width:540px;position:relative;margin:0 auto;" id="reg"> <fb:registration fields="name,birthday,gender,location,email" redirect uri="http://app.sunosunaao.com/test.php" width="530"> </fb:registration> </div>
But is there a way to show the above div after user login from FB.login ()? Because if I use FB.login (), it directly goes to the permissions page on Facebook and after connecting the conditions in the next function
response.status === 'connected' hence the registration plugin is not triggered FB.getLoginStatus(function(response) { if (response.status === 'not_authorized') { // show registration form document.getElementById('reg').style.display = "block"; } });
Any idea on how I can fake
<fb:login-button registration-url="<?php echo $config["base_url"]; ?>test.php" size="small"></fb:login-button> with FB.login();
source share