<SCRIPT>
Function gb2utf8 (data ){
VaR glbencode = [];
Gb2utf8_data = data;
ExecScript ("gb2utf8_data = midb (gb2utf8_data, 1)", "VBScript ");
VaR T = escape (gb2utf8_data ). replace (/% u/g ,""). replace (/(. {2 })(. {2})/g, "%$ 2% $1 "). replace (/% ([A-Z].) % (. {2})/g, "@ $1 $2 ");
T = T. Split ("@");
VaR I = 0, j = T. length, K;
While (++ I <j ){
K = T [I]. substring (0, 4 );
If (! Glbencode [k]) {
Gb2utf8_char = eval ("0x" + k );
ExecScript ("gb2utf8_char = CHR (gb2utf8_char)", "VBScript ");
Glbencode [k] = escape (gb2utf8_char). substring (1, 6 );
}
T [I] = glbencode [k] + T [I]. substring (4 );
}
Gb2utf8_data = gb2utf8_char = NULL;
Return Unescape (T. Join ("% "));
}
Function ajaxsubmit2 (){
Document. getelementbyid ("loginstate"). innerhtml = "<center> </center> ";
// Create an XMLHTTPRequest object
VaR XMLHTTP;
Try {
XMLHTTP = new XMLHttpRequest ();
} Catch (e ){
XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");
}
XMLHTTP. onreadystatechange = function (){
If (4 = XMLHTTP. readystate ){
If (200 = XMLHTTP. Status ){
VaR content = gb2utf8 (XMLHTTP. responsebody );
Document. getelementbyid ("loginstate"). innerhtml = content;
} Else {
Alert ("error ");
}
}
}
// Open the connection. True indicates asynchronous submission.
XMLHTTP. Open ("Post", "Time. php? Id = 1 ", true );
// Set the HTTP header as follows when the method is post
XMLHTTP. setRequestHeader ('content-type', 'application/X-WWW-form-urlencoded ');
// Send data
XMLHTTP. Send (null );
}
</SCRIPT>
<! 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>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> untitled document </title>
</Head>
<Body>
<Div id = "loginstate"> </div>
<Script language = "JavaScript"> ajaxsubmit2 (); </SCRIPT>
</Body>
</Html>