JavaScript DHTML/Javascript Objects/userProfile

Материал из Web эксперт
Перейти к: навигация, поиск

add Read Request

   <source lang="html4strict">
   

<html> <head> <script language="JavaScript"> function function1() {

   navigator.userProfile.addReadRequest("vCard.DisplayName");
   navigator.userProfile.doReadRequest(1, "Desk Reference"); 
   alert(navigator.userProfile.getAttribute("vcard.DisplayName"));
   navigator.userProfile.clearRequest(); 

} </script> </head> <body> <button onclick="function1();">Click here</button> </body> </html>


     </source>
   
  


"addReadRequest()" Example

   <source lang="html4strict">
   

<html> <head> <script language="JavaScript">

   function function1() {
       navigator.userProfile.addReadRequest("Business.phone");
       var m = navigator.userProfile.addReadRequest("Business.phone");
       alert(m);
   }

</script></head> <body> <button onclick="function1();">Add an entry to read request</button> </body> </html>


     </source>
   
  


Clear Request

   <source lang="html4strict">
   

<html> <head> <script language="JavaScript">

   function function1() {
       navigator.userProfile.clearRequest();
   }

</script> </head> <body> <button onclick="function1();">Clear the read-requests queue</button> </body> </html>


     </source>
   
  


"doReadRequest()" Example

   <source lang="html4strict">
   

<html> <head> <script language="JavaScript"> function function1() {

   userProfile.doReadRequest(5, "Microsoft");
   alert("done"); 

} </script> </head> <body> <button onclick="function1();"> Perform all requests located in the read-requests queue </button> </body> </html>


     </source>