Ajax technology is actually the XMLHTTP that I used many years ago:
1) <body onload = 'setinterval ("getdaytime ()", (getcookie ("oa_refreshtime") = ""? 30000: getcookie ("oa_refreshtime"); '>
2) function getdaytime ()
{
VaR AGT = navigator. useragent. tolowercase ();
VaR is_ie = (AGT. indexof ('msie ')! =-1 );
VaR is_ie5 = (AGT. indexof ('msie 5 ')! =-1 );
Function handle_do_search ()
{
If (XMLHTTP. readystate = 4) // request completed
{
If (XMLHTTP. Status = 200) // request successful
{
VaR requset = XMLHTTP. responsetext. Split (",");
Document. getelementbyid ("maxnum"). value = requset [1];
Getmaxnum ();
}
Else
{
// Alert ('no server answer! ');
}
}
}
VaR XMLHTTP = NULL;
If (is_ie)
{
Var control = (is_ie5 )? "Microsoft. XMLHTTP": "msxml2.xmlhttp ";
Try
{
XMLHTTP = new activexobject (control );
XMLHTTP. onreadystatechange = handle_do_search;
} Catch (E)
{
// Alert ("You need to enable active scripting and ActiveX controls ");
}
}
Else
{
XMLHTTP = new XMLHttpRequest ();
XMLHTTP. onload = handle_do_search;
XMLHTTP. onerror = handle_do_search;
}
XMLHTTP. Open ("get", "<% = request. getcontextpath () %>/getdb. jsp? Time = "+ (new date (), false );
XMLHTTP. Send (null );
}