Action 'onlogin' - Facebook Button Plugin

0

I have an App on Facebook, and the homepage has a button for if the user is not logged in to Facebook, so do. This button is a plugin from Facebook itself. I've read all of the documentation for this plugin, and this login button specifically has a setting called 'onlogin', so if I need to, I run some JS function after login is successfully processed.

Soon after the login process was done, I needed a single reload to be done on the entire page. It's that way (simple of everything!):

<script>
     function reloadPage(){
        window.location.reload();
 }
 </script>

Here is the button's ready plugin where I call the function in onlogin :

<div class="fb-login-button" data-max-rows="1" data-size="xlarge" data-show-faces="false" data-auto-logout-link="false" data-scope="email" onlogin="reload()"></div>

The thing is, it just does not work! How can I do this in any other way?

    
asked by anonymous 21.05.2014 / 20:12

1 answer

1

In the button's onlogin event, the name of the function to be called is reload .

The function you defined is called reloadPage .

Change from reload to reloadPage :

<div class="fb-login-button" data-max-rows="1" data-size="xlarge" data-show-faces="false" data-auto-logout-link="false" data-scope="email" onlogin="reloadPage"></div>

Sample code used in the test: link

In order for the page to be redirected, not the iframe, use top.location instead of window.location.

    
21.05.2014 / 20:31