Language References
Provides methods that allow a script to request read access to and perform read actions on a user's profile information.
Note that the request is queued up before the reading or writing action is performed. This simplifies the user experience because users are only prompted for profile release permissions once for a batch of requests.
userProfile Members
The following is an example of a script that can be run on the client to read various values from the profile information.
// Queue up a request for read access to multiple profile attributes.
navigator.userProfile.addReadRequest ( "vcard.displayname" );
navigator.userProfile.addReadRequest ( "vcard.gender" );
// Request access to this 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.
// This is to support getting back to a clean slate by clearing the request queue.
navigator.userProfile.clearRequest ( );