Export (0) Print
Expand All

initialize Method

Ff751528.note(en-us,MSDN.10).gifNote:
Current information about Live Connect is now available in the Windows Live Developer Center. The information in the following sections is provided for legacy purposes only.

Initializes the application on the current page. This method is invoked by the scanner if an <app> tag that uses the wl prefix is detected on the page. The method may also be invoked from script by the application. It can be invoked only once on the page. Attempting to initialize the application more than once results in an exception. The method takes a System.Dictionary value that contains key/value pairs representing property names and property values.

Script:  http://js.live.net/4.1/loader.js
Feature:  Microsoft.Live
Namespace:  Microsoft.Live
 

Microsoft.Live.App.initialize(initArgs);

Parameters

initArgs
Type: Dictionary

The initialization dictionary that contains property name/value pairs.

Use the initialize method to programmatically initialize the application. This approach is suitable in circumstances where the application uses dynamically generated markup and where preloading functionality is needed.

The following table shows the supported properties.

Property name Value
application-group-name The name of the application group that the application belongs to.
application-icon A graphic representing the application.
application-name The name of the application.
audio-enabled Indicates whether audio is enabled for the application.
callback-url The URL to the authentication handler page for the site.
channel-url The URL to the channel page for the site.
client-id The client ID that was assigned at registration.
client-state A string value that is used to track navigational state on the server side.
onload The name of the function to call when loading is complete.
onsignedin Specifies the name of the event handler to call when sign-in is complete.
onsignedout Specifies the name of the event handler to call after the user has signed out.
scope The list of offers being requested by the client (for example, "WL_Contacts.View").
styles-enabled Indicates whether styles are enabled.

The following example demonstrates how to call Microsoft.Live.App.initialize, by calling OnLoad()()() and passing the function body by way of a closure. Note that JavaScript Object Notation (JSON) markup is used to pass the parameters for the initialize method.

function bodyOnload() {
    Microsoft.Live.Core.Loader.onload(["microsoft.live"], function () {
        Microsoft.Live.App.initialize({
            channelurl: "http://<Your-Domain>/channel.html",
            callbackurl: "http://<Your-Domain>/OAuthWrapCallback.axd",
            clientid: "<Your-Client-ID>",
            scope: "WL_Contacts.View",
            onload: "appOnload"
        });
    });
}

Windows Live Messenger Connect

Supported in: 4.1

Internet Explorer 8.0, Internet Explorer 7.0, Internet Explorer 6.0, Firefox 3.6, Firefox 3.5, Firefox 3.0, Firefox 2.0, Firefox 1.5, Chrome 4.0, Chrome 3.0, Chrome 2.0, Chrome 1.0, Safari 4.0, Safari 3.0

Show:
© 2015 Microsoft