ContactUrl Class

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

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

Script:  http://js.live.net/4.1/loader.js
Feature:  Microsoft.Live.Services
Namespace:  Microsoft.Live.Services
 
Ff748721.alert_note(en-us,MSDN.10).gifNote

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

Type.registerClass(
    'Microsoft.Live.Services.ContactUrl',
    Microsoft.Live.Services.DataItem);

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");
        contactUrl1.set_value("http://www.contoso.com");
        contactUrl1.set_type(Microsoft.Live.Services.ContactUrlType.personal);
        contact1.set_urls([contactUrl1]);
        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;

Object
  Microsoft.Live.Services..::.DataItem
    Microsoft.Live.Services..::.ContactUrl

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: