Export (0) Print
Expand All

DataType Class

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.

Represents the resource types that are available in Windows Live.

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

The JavaScript Library for Windows Live Messenger Connect is built by using the Microsoft Ajax Library. Microsoft Ajax exposes a type system that enables you to add object-oriented capabilities to your JavaScript code. To learn more about creating, instantiating, and deriving from classes, see Creating Custom Client Script by Using the Microsoft Ajax Library.

Microsoft.Live.DataType = function();


The DataType class defines the resource types that you can use with the JavaScript API. A typical scenario that uses the fields in the DataType class is loading an object of class DataCollection from Windows Live. You want to specify the type of data resource that you want to load. For example, if you want to load contacts, use the contacts field of the DataType class in the load method or the loadAll method of the DataContext class.

The resource types that are available when you use the JavaScript API include contacts, contact categories, profiles, and recent activities.

The following code example demonstrates how to load contact and profile information from the dataContext property of an application instance. The loadAll method of the DataContext class is used with the contacts field for the Contact resource and with the profile field for the Profile resource.

function loadContactsAndProfiles(dataContext) {
    dataContext.loadAll(Microsoft.Live.DataType.contacts, function(eventArgs) {
        if (eventArgs.get_resultCode() !== Microsoft.Live.AsyncResultCode.success) {
            alert("Contacts not loaded.");
    dataContext.loadAll(Microsoft.Live.DataType.profile, function(eventArgs) {
        if (eventArgs.get_resultCode() !== Microsoft.Live.AsyncResultCode.success) {
            alert("Profiles not loaded.");


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

© 2014 Microsoft