function createXMLHttps()
{
var ret =null;
try {
ret = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (e){
try {
ret = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (ee) {
ret = null;
}
}
if (!ret&& typeof XMLHttpRequest != 'undefined')
ret = new XMLHttpRequest();
returnret;
}
//get方法传输
function ajax(URL,DIVID)
{
var DIVID=document.getElementByIdx_x(DIVID);
if(DIVID)
{
jiazai = 'yes';
DIVID.innerHTML = ''
var xmlhttp = createXMLHttps();
xmlhttp.open("GET",URL,true);
xmlhttp.onreadystatechange = function()
{
//alert(xmlhttp.responseText);
if (xmlhttp.readyState == 4&& xmlhttp.status == 200)
{
DIVID.innerHTML= xmlhttp.responseText;
}
}
xmlhttp.send(null);
}
}
//post方法传输
function ajax(URL,DIVID)
{
var DIVID=document.getElementByIdx_x(DIVID);
if(DIVID)
{
jiazai = 'yes';
DIVID.innerHTML = ''
var xmlhttp = createXMLHttps();
xmlhttp.open("POST",URL,true);
xmlhttp.onreadystatechange = function()
{
//alert(xmlhttp.responseText);
if (xmlhttp.readyState == 4&& xmlhttp.status == 200)
{
DIVID.innerHTML= xmlhttp.responseText;
}
}
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.send('dd=ggg');
}
}