All Tech Tips

userProfile Object

Provides methods that allow a script to request read access to and perform read actions on a user's profile information.

Members Table

MethodDescription
addReadRequest Adds an entry to the queue for read requests.
clearRequest Clears all requests in the read-requests queue to prepare for new profile-information requests.
doReadRequest Performs all requests located in the read-requests queue.
getAttribute Returns the value of the named attribute from the userProfile object.
setAttribute Sets the value of the specified attribute.

Remarks

The script request is queued before reading or writing is performed. This simplifies user experience, because users are prompted only once for profile release permissions for a batch of requests.

This object is available in script as of Microsoft Internet Explorer 4.0.

Example

This script example runs on the client and uses the userProfile object to read various values from the profile information.

// Queue a request for read access to multiple profile attributes.
navigator.userProfile.addReadRequest("vcard.displayname");
navigator.userProfile.addReadRequest("vcard.gender");

// Request access to the information.
navigator.userProfile.doReadRequest(usage-code, "Acme Corporation");

// Now perform read operations to access the information.
name = navigator.userProfile.getAttribute("vcard.displayname");
gender = navigator.userProfile.getAttribute("vcard.gender");

// The script can now use the 'name' and 'gender' variables
// to personalize content or to send information back to the server.

// Clear the request queue to prepare for later information requests.
navigator.userProfile.clearRequest();

Standards Information

There is no public standard that applies to this object.

Applies To

clientInformation, navigator


Copyright © 2006 alltechtips.com. All rights reserved.

This website and the materials and information you find on this website are provided "as is", without warranty of any kind, either express or implied, including without limitation any warranty for information, services, or products provided through or in connection with the service and any implied warranties of merchantability, fitness for a particular purpose, expectation of privacy or non-infringement.