Because the template page is long, only Ajax is logged out. Code Part, that is, the part before the <body> label
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< Script Type = "Text/JavaScript" Language = "JavaScript" >
// Create functions for XMLHttpRequest objects with multiple browsers
Function Getxmlrequester (){
VaR Xmlhttp_request = False ;
Try {
If (Window. activexobject ){
For ( VaR I = 5 ; I -- ){
Try {
If (I = 2 ) {Xmlhttp_request = Newactivexobject ( " Microsoft. XMLHTTP " );
} Else {Xmlhttp_request = New Activexobject ( " Msxml2.xmlhttp. " + I + " . 0 " );
Xmlhttp_request.setrequestheader ( " Content-Type " , " Text/XML " ); Xmlhttp_request.setrequestheader ( " Content-Type " , " Gb2312 " );
}
Break ;}
Catch (E ){
Xmlhttp_request = False ;
}
}
} Else If (Window. XMLHttpRequest ){
Xmlhttp_request = New XMLHttpRequest ();
If (Xmlhttp_request.overridemimetype ){
Xmlhttp_request.overridemimetype ('text / Xml ');
}
}
}
Catch (E ){
Xmlhttp_request = False ;
}
Return Xmlhttp_request;
}
Function Idrequest (){
// Defines the JavaScript function to be executed after receiving the response from the server.
URL = 'Checklogin. aspx' // Define URL parameters
// Alert (URL );
Xmlhttp_request = Getxmlrequester (); // Call the function for creating XMLHttpRequest
Xmlhttp_request.onreadystatechange = Docontents; // Call the docontents Function
Xmlhttp_request.open ('post', URL, True );
Xmlhttp_request.send ( Null );
}
Function Docontents (){
If (Xmlhttp_request.readystate = 4 ){ // Receives the complete Server Response
If (Xmlhttp_request.status = 200 ){ // The HTTP server response value is OK.
VaR Str = Xmlhttp_request.responsetext; // Write the string returned by the server to the region where the ID is message on the page.
If (Str. Length > 583 )
{
// Self. Location = "../login. aspx ";
Location. href = '.. / Login. aspx ';
}
} Else {
Alert (http_request.status );
}
}
}
Idrequest ();
</ Script >
< Html Xmlns = "Http://www.w3.org/1999/xhtml" >
< Head Runat = "Server" >
< Title > $ Chapter $ --> $ order $ --> $ title $ </ Title >
< Link Href = "../Stylesheet.css" REL = "Stylesheet" Type = "Text/CSS" />
</ Head >