JSFiddle - React, Tailwind, and code Playground

by Martin Sjåstad

JavaScript

function handle_vote_link()
{
    $('#stemming').submit(function(){
        var this_form = this;
        FB.getLoginStatus(function(response) {
            if (response && response.authResponse)
            {
                this_form.submit();
            }
            else
            {
                FB.login(function(response) {
                    if (response && response.authResponse)
                    {
                        this_form.submit();
                    }
                    else
                    {
                        alert('For å se stemme må du autorisere applikasjonen slik at vi kan hente ut din bruker id.');
                    }
                });
            }
        });
        return false;
    });
}