StatusCollection 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 a collection of objects of class StatusMessage.

Feature:  Microsoft.Live.Services
Namespace:  Microsoft.Live.Services

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.Services.StatusCollection = function();


The StatusCollection object contains only one item, a StatusMessage object. To work with the StatusMessage object that is contained in a StatusCollection object, use the statusMessage property to get the StatusMessage object, and then get the statusText property or other properties of the StatusMessage object.

The following example demonstrates how to work with a status collection. The StatusCollection object is loaded from the DataContext object that is obtained from the dataContext property of the App class.

        function signIn(signInCompletedEventArgs) {
            if (signInCompletedEventArgs.get_resultCode() != Microsoft.Live.AsyncResultCode.success) {
                alert("sign-in failed: " + Microsoft.Live.AsyncResultCode.toString(signInCompletedEventArgs.get_resultCode()));
            // Get data context and load contacts.
            dataContext = Microsoft.Live.App.get_dataContext();
            dataContext.loadAll(Microsoft.Live.DataType.statusMessage, statusMessageLoaded);

        function statusMessageLoaded(dataLoadCompletedEventArgs) {
            if (dataLoadCompletedEventArgs.get_resultCode() !== Microsoft.Live.AsyncResultCode.success) {
                alert("StatusMessage failed to load: " + Microsoft.Live.AsyncResultCode.toString(dataLoadCompletedEventArgs.get_resultCode()));
            statusCollection = dataLoadCompletedEventArgs.get_data();

        function loadStatusMessage() {
            var statusMessage = statusCollection.get_statusMessage();
            var statusMessageType = Microsoft.Live.Services.StatusMessageType.toString(statusMessage.get_type());
            var prefix = "";
            if (statusMessageType === "simpleText") {
                prefix = "text message: ";
            else if (statusMessageType === "photo" || statusMessageType === "link" || statusMessageType === "linkToVideo") {
                prefix = "<a href='" + statusMessage.get_uxLink() + "' target='_blank'>link</a> ";

            else if (statusMessageType === "document") {
                prefix = "<a href='" + statusMessage.get_uxLink() + "' target='_blank'>document</a> ";

            else {
                // Handle other types.
            $get('StatusMessage').innerHTML = prefix + statusMessage.get_statusText(); // Set UI element.

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