Accessing userProfile Data : Table « HTML « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Event
7. Event onMethod
8. Form Control
9. GUI Components
10. HTML
11. Javascript Collections
12. Javascript Objects
13. Language Basics
14. Node Operation
15. Object Oriented
16. Page Components
17. Security
18. Style Layout
19. Table
20. Utilities
21. Window Browser
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
JavaScript DHTML » HTML » Table 
Accessing userProfile Data

/*
JavaScript Bible, Fourth Edition
by Danny Goodman 

John Wiley & Sons CopyRight 2001
*/


<HTML>
<HEAD>
<TITLE>userProfile Object</TITLE>
<SCRIPT LANGUAGE="JavaScript">
var attrs = ["Business.City","Business.Country","Business.Fax",
             "Business.Phone","Business.State","Business.StreetAddress",
             "Business.URL","Business.Zipcode","Cellular","Company",
             "Department","DisplayName","Email","FirstName",
             "Gender","Home.City","Home.Country","Home.Fax",
             "Home.Phone","Home.State","Home.StreetAddress",
             "Home.Zipcode","Homepage","JobTitle","LastName",
             "MiddleName","Notes","Office","Pager"]
function loadTable() {
    // make sure this executes only in IE4+ for Windows
    if ((navigator.userAgent.indexOf("Win"!= -1&& navigator.userProfile) {
        var newRow, newCell, attrValue
        // queue up requests for every vCard attribute
        for (var i = 0; i < attrs.length; i++) {
            navigator.userProfile.addReadRequest("vCard." + attrs[i])
        }
        // dispatch the request to let user accept or deny access

navigator.userProfile.doReadRequest(1"JavaScript Bible")
        // append rows to the table with attribute/value pairs
        for (var j = 0; j < attrs.length; j++) {
            newRow = document.all.attrTable.insertRow(-1)
            newRow.bgColor = "#FFFF99"
            newCell = newRow.insertCell(0)
            newCell.innerText = "vCard." + attrs[j]
            newCell = newRow.insertCell(1)
            // get the actual value
            attrValue = navigator.userProfile.getAttribute("vCard." + attrs[j])
            newCell.innerHTML = (attrValue? attrValue : "&nbsp;"
        }
        // clean up after ourselves
        navigator.userProfile.clearRequest()
    else {
        alert("This example requires IE4+ for Windows.")
    }
}
</SCRIPT>
</HEAD>
<BODY onLoad="loadTable()">
<H1>userProfile Object</H1>
<HR>
<TABLE ID="attrTable" BORDER=CELLPADDING=5>
<TR BGCOLOR="#CCFFFF">
    <TH>vCard Property<TH>Value
</TR>
</TABLE>
</BODY>
</HTML>

           
       
Related examples in the same category
1. Tabular data in Javascript with hyper link
2. Change the width of a table border
3. Change the cellPadding and cellSpacing of a table
4. Specify frames of a table
5. Change table row height
6. Specify rules for a table
7. Create table caption
8. Deleting table rows
9. Adding table rows
10. Align the cell content in a table row
11. Change the cell content in a table row
12. Vertical align the cell content in a table row
13. Align the cell content in a single cell
14. Vertical align the cell content in a single cell
15. Adding cells to a table row
16. Change the colspan of a table row
17. Insert table row: the uniqueID Property
18. Using the cloneNode Method
19. Cycling Through Table frame Property Values
20. Replacing Table Cell Content
21. Inserting/Removing Row Elements
22. Modifying Table Columns
23. Cycling Through Table rows Property Values
24. Using the Data Binding record Number Property
25. Using the offsetParent Property
26. Transforming JavaScript Data into HTML Tables
27. Transforming JavaScript Data into HTML Tables with HyperLink
w_ww.j___a___v_a___2___s._com | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.