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

Showing posts with label SkyDrive. Show all posts
Showing posts with label SkyDrive. Show all posts

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);
            }
        );
    });
});

Codecademy Sample Solution: Initializing the Javascript SDK


//sample solution to the helper.js file

WL.init({
    client_id: ('000000004C0E2C11')
    redirect_uri: ('http://external.codecademy.com/skydrive.html')
});

Codecademy Sample Solution: Setting Up


<!DOCTYPE html>
<html>
<head>
<title>My SkyDrive Web App</title>
        <!-- Add wl.js here -->
        <script src="http://js.live.net/v5.0/wl.js"></script>
        <script src="helper.js"></script>
</head>
<body>
        <p>Hello there! We'll fill this part out soon.</p>
    </body>
</html>

This is an example of scrolling text using Javascript.

Popular Posts