简体   繁体   中英

Javascript login/signup callback functions

I'm working on a magento extension,all based on javascript and i need to integrate a widget from Wordpress. I have the event.js from view /widgets

/* links events */
    var eventLinks = function() {
        var $loginBtn = my.html.find('.att-login'),
            $signupBtn = my.html.find('.att-signup');

        /* login btn event */
        $loginBtn.on('click', function() {
            BYND.widgets.log('[INFO]', '[LANDING PAGE] - Login button clicked');

            BYND.Auth.Login(function() {
                window.location.href = 'collections.html?page=my_collections';
            });

            return false;
        });

        /* signup btn event */
        $signupBtn.on('click', function() {
            BYND.widgets.log('[INFO]', '[LANDING PAGE] - Signup button clicked');

            BYND.Auth.Signup(function() {
                window.location.href = 'collections.html?page=my_collections';
            });

            return false;
        });
    },

And i need to make some callbacks for login/signup functions so my login box(already made in WP) pops up

Any help?

I suppose function you are looking for (callback for signup) is here:

 BYND.Auth.Signup(function() {
            // replace that line with your code
            window.location.href = 'collections.html?page=my_collections';
        });

If you would like to show that page as a popup you could use another window, or iframe...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM