SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    navigator vcards

    i just got some code off microsoft, but it doesn't appear to work

    as i get an error with usage-code being undeclared.

    how can i get this to work?

    PHP Code:

    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 future information requests.
    navigator.userProfile.clearRequest(); 

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anyone know?

  3. #3
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's just a variable. You're gonna have to declare it and set it's value accordingly for it to be of any use.

    doReadRequest Method

  4. #4
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i did get this from msdn, but i cannot seem to get it to work so could you give me an example plz

    thank you

  5. #5
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess I should have said, I haven't got any experience with the navigator object.

    From reading the MS docs I'm not really sure what the navigator object is used for. Can you explain what you're trying to do?

    I'll have a play about and hopefully I can at least be of some use.

    Edit>>

    OK, I think I get it now.
    Using the Profile Assistant

    The following script works for me.

    Code:
    <script type="text/javascript">
    
    var usagecode = 1 //Dev;
    
    navigator.userProfile.addReadRequest("vcard.displayname");
    navigator.userProfile.addReadRequest("vcard.gender");
    
    // Request access to the information.
    navigator.userProfile.doReadRequest(usagecode, "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 future information requests.
    navigator.userProfile.clearRequest();
    
    alert("Name: " + name + "\n" + "Gender: " + gender);
    
    </script>
    Last edited by shane; Apr 13, 2002 at 11:02.

  6. #6
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cheers 4 that for sum reason it works even though i copied the same code, i must of messed sumink up, but i seem to get a blank for the name and gender. I guess its b-coz i havent got them setup properly


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •