Jilian.htm
Copy Code code as follows:
<script language= "JavaScript" >
var Http_request=false;
function send_request (URL) {//initialization, specifying handler functions, sending requested functions
Http_request=false;
Start initializing the XMLHttpRequest object
if (window. XMLHttpRequest) {//mozilla browser
Http_request=new XMLHttpRequest ();
if (http_request.overridemimetype) {//Set MIME type
Http_request.overridemimetype ("text/html");
}
}
else if (window. ActiveXObject) {//ie browser
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) {//exception, failed to create object instance
Window.alert ("Cannot create XMLHttpRequest object instance");
return false;
}
Http_request.onreadystatechange=processrequest;
Determine how and when the request is sent and whether the next code is executed synchronously
Http_request.open ("Get", url,true);
Http_request.send (NULL);
}
Functions that process return information
function ProcessRequest () {
if (http_request.readystate==4) {//Judge object state
if (http_request.status==200) {//information has been successfully returned, start processing information
document.getElementById (Currentpos). Innerhtml=http_request.responsetext;
}
else{//page is not normal
Alert ("The page you requested has an exception");
}
}
}
function Showroles (obj) {
document.getElementById (obj). parentnode.style.display= "";
document.getElementById (obj). innerhtml= "reading data ..."
Currentpos=obj;
Send_request ("jilian_data.asp?playpos=" +obj);
}
</script>
<table width= "border=" 0 "cellspacing=" 0 "cellpadding=" 0 ">
<tr>
<TD height= ">"
<a href= "javascript:void (0)" onclick= "Showroles (' Pos_1 ')" > manager's Office
</a>
</td>
</tr>
<tr style= "Display:none" >
<TD height= "id=" Pos_1 > </td>
</tr>
<tr>
<TD height= ">"
<a href= "javascript:void (0)" onclick= "Showroles (' pos_2 ')" > Development Department </a>
</td>
</tr>
<tr style= "Display:none" >
<TD id= "pos_2" height= "> </td>
</tr>
</td>
</table>
Jilian_data.asp
Copy Code code as follows:
<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<%
Playpos=request ("Playpos")
if playpos= "Pos_1" then
Response.Write (" jingli<br > deputy General Manager ")
End if
if playpos=" pos_2 " then
Response.Write (" chief Engineer <br> Software Engineer ")
End if
%>