userProfileNN n/a IE 4(Win) DOM n/a  

  

The userProfile object reflects numerous pieces of information stored in the browser's user profile for the current user. This object has four methods that:

  • Let you queue requests for individual fields of the profile (items such as name, mailing address, phone numbers, and so on)

  • Display the request dialog that lets users see what you're asking for and disallow specific items or the whole thing

  • Grab the information

  • Clear the request queue

 

Once the information is retrieved (with the user's permission), it can be slipped into form elements (visible or hidden) for submission to the server. Compatibility listings here indicate support in IE for Windows only. While IE for Macintosh accepts the method calls without error, there is no functionality attached to those methods. Further details on the user profile are available from Microsoft at http://msdn.microsoft.com/workshop/management/profile/profile_assistant.asp.

 
Example
 
navigator.userProfile.addReadRequest("vcard.displayname");
navigator.userProfile.doReadRequest("3", "MegaCorp Customer Service");
var custName = navigator.userProfile.getAttribute("vcard.displayname");
navigator.userProfile.clearRequest( );
if (custName) {
    ...
}
 
Object Model Reference
 
navigator.userProfile
 
Object-Specific Properties

None.

 
Object-Specific Methods
 
addReadRequest( )clearRequest( )doReadRequest( )getAttribute( )
 
Object-Specific Event Handler Properties

None.

addReadRequest( )NN n/a IE 4(Win) DOM n/a  

addReadRequest("attributeName")

  

Adds a request to inspect a particular user profile attribute to a queue that must be executed separately (via the doReadRequest( ) and getAttribute( ) methods). Items added to the queue are displayed to the user to select which item(s) can be submitted to a server. For multiple attributes, use multiple invocations of the addReadRequest( ) method.

 
Parameters
 
vCard.Business.CityvCard.Business.Country
vCard.Business.FaxvCard.Business.Phone
vCard.Business.StatevCard.Business.StreetAddress
vCard.Business.URLvCard.Business.Zipcode
vCard.CellularvCard.Company
vCard.DepartmentvCard.DisplayName
vCard.EmailvCard.FirstName
vCard.GendervCard.Home.City
vCard.Home.CountryvCard.Home.Fax
vCard.Home.PhonevCard.Home.State
vCard.Home.StreetAddressvCard.Home.Zipcode
vCard.HomepagevCard.JobTitle
vCard.LastNamevCard.MiddleName
vCard.NotesvCard.Office
vCard.Pager
 
  • One of the following case-insensitive attribute names as a string:
 
Returned Value

Boolean value: true (if successful) | false (if unsuccessful).

clearRequest( )NN n/a IE 4(Win) DOM n/a  

  

Empties the queue of attribute names to be retrieved. Use this after your script has successfully retrieved the required information. This prepares the queue for the next list.

 
Parameters

None.

 
Returned Value

None.

doReadRequest( )NN n/a IE 4(Win) DOM n/a  

doReadRequest(usageCode[, "friendlyName"[, "domain"[, "path"[, "expiration"]]]])

  

Based on the items in the queue, this method inspects the browser to see whether the user has given permission to inspect these attributes in the past. If not (for some or all), the method displays a dialog box (the Profile Assistant window) that lets users turn off the items that should not be exposed to the server. Parameters provide information for the dialog and for maintenance of the permission (similar to the ways that cookies are managed). Only one doReadRequest( ) method is required, regardless of the number of attributes in the queue.

 
Parameters
 
CodeMeaning
0Used for system administration.
1Used for research and/or product development.
2Used for completion and support of current transaction.
3Used to customize the content and design of a site.
4Used to improve the content of the site, including advertisements.
5Used for notifying visitors about updates to the site.
6Used for contacting visitors for marketing of services or products.
7Used for linking other collected information.
8Used by site for other purposes.
9Disclosed to others for customization or improvement of the content and design of the site.
10Disclosed to others who may contact you for marketing of services and/or products.
11Disclosed to others who may contact you for marketing of services and/or products, but you have the opportunity to ask a site not to do this.
12Disclosed to others for any other purpose.
 
  • One of the following code integers that display human-readable messages defined by the Internet Privacy Working Group, as shown in the following table.
 
  • An optional string containing an identifiable name (and URL) that the user recognizes as the source of the request. This may be a corporate identity.
  • An optional string containing the domain of the server making the request. If an expiration date is set, this information is stored with the requested attributes to prevent future requests from this domain from interrupting the user with the Profile Assistant dialog box.
  • An optional string containing the path of the server document making the request. If an expiration date is set, this information is stored with the requested attributes to prevent future requests from this domain from interrupting the user with the Profile Assistant dialog box.
  • An optional string containing the date on which the user's permissions settings expire. Not recognized in Internet Explorer 4.
 
Returned Value

In Windows, the method returns no value, regardless of how the user responds to the Profile Assistant dialog box. On the Macintosh (which does not support this object fully), the method does not display the Profile Assistant dialog box and returns false.

getAttribute( )NN n/a IE 4 DOM n/a  

getAttribute("attributeName")

  

Returns the value of the attribute, provided the user has given permission to do so. If that permission was denied, the method returns null. Use one getAttribute( ) method for each attribute value being retrieved.

 
Parameters
 
  • One of the vCard attribute names listed in the addReadRequest( ) method description.
 
Returned Value

String value or null