📄 userprofile object.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="userProfile Object.aspx.cs" Inherits="userProfile_Object" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>userProfile Object</title>
<script type="text/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",
"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 : " ";
}
// clean up after ourselves
navigator.userProfile.clearRequest();
} else {
alert("This example requires IE4+ for Windows.");
}
}
//-->
</script>
</head>
<body onload="loadTable()">
<form id="form1" runat="server">
<h1>userProfile Object</h1>
<hr />
<table id="attrTable" border="1" cellpadding="5">
<tr >
<th>vCard Property</th>
<th>Value</th>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -