Contact Constructor

Ff752532.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 a new instance of the Contact class.

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

var instance = new Microsoft.Live.Services.Contact(nameOrEmail);

Parameters

nameOrEmail
Type: Object

Describes a string that represents the firstName or a ContactEmail object to be added to the emails property.

An exception is thrown if you call the constructor with a parameter that is not a string that represents a firstName or a ContactEmail object. All other property values in the new instance of Contact are set to the value undefined (JavaScript) by default.

The following example demonstrates the creation of two contacts. One contact is initialized with a string, and the other contact is initialized with a ContactEmail object.

    var contact1 = new Microsoft.Live.Services.Contact("contact1");
    contact1.set_lastName("lastname1");

    var contact2 = new Microsoft.Live.Services.Contact(
        new Microsoft.Live.Services.ContactEmail("contact2@contoso.com").get_address()
    );
    contact2.set_firstName("contact2");
    contact2.set_lastName("lastname2");

ExceptionCondition
Exception

The constructor was not called with a string or a ContactEmail object.

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: