今天看了一下AJAX,原始的写法。不错。看懂了但是记不住!有待于实践呀。
function ajax(url,fnsuss,fnfaild)
{
if(windows.XMLHttpRequest)
{
var oAjax=new XMLHttpRequest();
}
else
{
var oAjax=ActiveXObject("Microsoft.XMLHTTP");
}
oAjax.open("GET",url,true);
oAjax.send();
oAjax.onreadystatechange=function ()
{
if(oAjax.onreadystate==4)
{
if(oAjax.status==200)
{
fnsucc(oAjax.responseText);
}else
{
if(fnfaild)
{
fnfaild(oAjax.status);
}
}
}
}
}