Quotes help make search much faster. Example: "Practice Makes Perfect"

Tuesday, June 18, 2013

Codecademy Sample Solution: Logging In The User



// The callback URL to redirect to after authentication
redirectUri = "http://external.codecademy.com/skydrive.html";

//sample solution to helper.js
//note: you have to have a Microsoft account in order to log-in and finish the exercise
// Initialize the JavaScript SDK

WL.init({
    client_id: '000000004C0E2C11',
    redirect_uri: redirectUri
});

$(document).ready(function() {
    // Start the login process when the login button is clicked
    $('#login').click(function() {
        WL.login({
            scope: ["wl.skydrive wl.signin"]
        }).then(
            // Handle a successful login
            function(response) {
                $('#status').html("<strong>Success! Logged in.</strong>");
            },
            // Handle a failed login
            function(responseFailed) {
                // The user might have clicked cancel, etc.
                $('#status').html(responseFailed.error.message);
            }
        );
    });
});

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts