javascript读取xml实现应用程序菜单效果
/*样式*/
<style type="text/css">
td{font-size:12px;}
.item{text-decoration:none;width:100%;height:100%; line-height:22px;cursor:default;color:Black;vertical-align:middle}
.staticTab{cursor:default;height:22px}
.staticTD{width:70px;text-align:center; vertical-align:middle;white-space:nowrap}
.dynamicTR{height:22px; vertical-align:middle}
.dynamicTab{width:60px;cursor:default;background-color:#ccebff;position:absolute;z-index:1}
.dynamicTDRight{text-align:right;font-size:9px;}
.dynamicTDCenter{text-align:left;white-space:nowrap}
</style>
/*--------------菜单应用到的js--------------------*/
var menuHTML="";
function createXMLHttpRequest(){xmlHttp=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();}
function getMenuData(){//从后太获取头部的单据或审批人等的信息
createXMLHttpRequest();
xmlHttp.open("GET","Menu.ashx?id="+(new Date()).getTime(),true);
xmlHttp.onreadystatechange=getMenu_onreadystatechange;//用函数名,不加括号.
xmlHttp.send(null);
}
function getMenu_onreadystatechange(){//相应处理
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
var menuXML=xmlHttp.responseXML.getElementsByTagName("menu");//childNodes
createStaticMenu(menuXML[0]);
}else
alert('服务器端发生错误!');
}
}
function getId(number,fatherId){
number+=1;
if(number<1
相关文档:
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......
var myDate = new Date();
myDate.getYear(); //获取当前年份(2位)
myDate.getFullYear(); //获取完整的年份(4位,1970-????)
myDate.getMonth(); //获取当前月份(0-11,0代表1 ......
<!---------<html>
<head>
<style type="text/css">
.tabheader table {
border-collapse: collapse; /* for IE */
border-spacing: 0; /* for N6 */
}
.tabheader table tr td {mar ......