JavaScript DHTML/Javascript Objects/userProfile

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

add Read Request

    
<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>



"addReadRequest()" Example

    
<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>



Clear Request

    
<html>
<head>
<script language="JavaScript">
    function function1() {
        navigator.userProfile.clearRequest();
    }
</script>
</head>
<body>
<button onclick="function1();">Clear the read-requests queue</button>
</body>
</html>



"doReadRequest()" Example

    
<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>