jilian.htm
复制代码 代码以下:
<script language="javascript">
var http_request=false;
function send_request(url){//复位,特定处理函数,推送要求的涵数
http_request=false;
//刚开始复位XMLHttpRequest目标
if(window.XMLHttpRequest){//Mozilla电脑浏览器
http_request=new XMLHttpRequest();
if(http_request.overrideMimeType){//设定MIME种类
http_request.overrideMimeType("text/HTML");
}
}
else if(window.ActiveXObject){//IE电脑浏览器
try{
http_request=new ActiveXObject("Xsxml2.XMLHTTP");
http_request.setRequestHeader("Content-Type","text/xml");
http_request.setRequestHeader("Content-Type","gb2312");
}
catch(e){
try{
http_request=new ActiveXObject("Microsoft.XMLHTTP");
http_request.setRequestHeader("Content-Type","text/xml");
http_request.setRequestHeader("Content-Type","gb2312");
}
catch(e){
}
}
}
if(!http_request){//出现异常,创建对象案例不成功
window.alert("不可以建立XMLHttpRequest目标案例");
return false;
}
http_request.onreadystatechange=processRequest;
//明确推送要求的方法和URL及其是不是同歩实行下段代码
http_request.open("GET",url,true);
http_request.send(null);
}
//解决回到信息内容的涵数
function processRequest(){
if(http_request.readyState==4){//分辨目标情况
if(http_request.status==200){//信息内容早已取得成功回到,刚开始解决信息内容
document.getElementById(currentPos).innerHTML=http_request.responseText;
}
else{//网页页面异常
alert("您所要求的网页页面有出现异常");
}
}
}
function showRoles(obj){
document.getElementById(obj).parentNode.style.display="";
document.getElementById(obj).innerHTML="已经获取数据..."
currentPos=obj;
send_request("jilian_data.asp?playPos=" obj);
}
</script>

<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20">
<a href="javascript:void(0)" onclick="showRoles('pos_1')">老总办公室
</a>
</td>
</tr>
<tr style="display:none">
<td height="20" id="pos_1">&nbsp;</td>
</tr>
<tr>
<td height="20">
<a href="javascript:void(0)" onclick="showRoles('pos_2')">研发部</a>
</td>
</tr>
<tr style="display:none">
<td id="pos_2" height="20">&nbsp;</td>
</tr>
</td>
</table>

jilian_data.asp
复制代码 代码以下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
playPos=request("playPos")
if playPos="pos_1" then
Response.Write("&nbsp;&nbsp;jingli<br>&nbsp;&nbsp;总经理")
end if
if playPos="pos_2" then
Response.Write("&nbsp;&nbsp;高级工程师<br>&nbsp;&nbsp;前端工程师")
end if
%>