function Getxmlhttp ()
{
var http_request;
if (window. XMLHttpRequest) {
Http_request = new XMLHttpRequest ();
if (Http_request.overridemimetype) {
Http_request.overridemimetype ("Text/xml");
}
}
else if (window. ActiveXObject) {
try {
Http_request = new ActiveXObject ("Msxml2.xmlhttp");
catch (e) {
try {
Http_request = new ActiveXObject ("Microsoft.XMLHTTP");
catch (e) {}
}
}
if (!http_request) {
Window.alert ("can" T create XMLHttpRequest object);
return null;
}
return http_request;
}
function Loadajaxtab (Url,contentid) {
var ocontent=getelement (ContentID);
if (ajccache[url]==null) {
var xhttp=getxmlhttp ();
Xhttp.onreadystatechange=function () {
if (xhttp.readystate = 4 && (xhttp.status==200 | | window.location.href.indexOf ("http") ==-1))
{
Ocontent.innerhtml=xhttp.responsetext;
ajccache[url]=ocontent.innerhtml;
}
}
Xhttp.open ("Get", url,true);
Xhttp.send (NULL);
}else{
Ocontent.innerhtml=ajccache[url];
}
}
Window.onerror=function () {return true}
Xml.js
var xhr;
function Getxhr ()
{
try {
Xhr=new ActiveXObject ("msxml2.xmlhttp");
catch (e) {
try {
Xhr=new ActiveXObject ("Microsoft.XMLHTTP");
catch (e) {
Xh*=**lse;
}
}
if (!xhr&&typeof xmlhttprequest!= ' undefined ')
{
Xhr=new XMLHttpRequest ();
}
return XHR;
}
function Openxhr (method,url,callback)
{
GETXHR ();
Xhr.open (Method,url);
Xhr.onreadystatechange=function ()
{
if (xhr.readystate!=4) return;
Callback (XHR);
}
Xhr.send (NULL);
}
function Loadxml (method,url,callback)
{
GETXHR ();
Xhr.open (Method,url);
Xhr.setrequestheader ("Content-type", "Text/xml");
Xhr.setrequestheader ("Content-type", "GBK");
Xhr.onreadystatechange=function ()
{
if (xhr.readystate!=4) return;
Callback (XHR.RESPON***ML);
}
Xhr.send (NULL);
}
//=================================================
function quote (XHR)
{
alert (Xhr.responsetext);
document.getElementById ("xml"). Innertext=xhr.responsetext;
}