ContactUrl 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.

A instance of DataItem that provides programmatic access to URL information for a Windows Live contact .

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


When you request contacts for an authenticated user from Windows Live, you receive an instance of ContactCollection that is a collection of Contact objects. Each contact instance exposes properties that define the contact. The urls property of the Contact class allows programmatic access to contact URL information for the contact.

The following example demonstrates how to create an instance of ContactUrl and how to get and set properties of the instance. Note that properties of ContactUrl that are not defined return undefined (JavaScript).

        var sb;
        var br = "<br/>";
        var out = document.getElementById("Output");
        var contact1 = new Microsoft.Live.Services.Contact("test");
        var contactUrl1 = new Microsoft.Live.Services.ContactUrl();
        contactUrl1.set_name("test url name");
        sb = "Url Name = " + contact1.get_urls()[0].get_name() + br;
        sb += "Url Value = " + contact1.get_urls()[0].get_value() + br;
        sb += "Url Type = " + Microsoft.Live.Services.ContactUrlType.toString(contact1.get_urls()[0].get_type()) + br;
        sb += "Url Id = " + contact1.get_urls()[0].get_id() + br;
        out.innerHTML = sb;


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