The code is as follows:
function Ajax(url,fnSucc,fnFaild)
{
//1. Create ajax object
If(window.XMLHttpRequest)
{// code for IE7, Firefox, Chrome, Opera, Safari
var oAjax=new XMLHttpRequest();
}
Else
{// code for IE6, IE5
var oAjax=new ActiveXObject("Microsoft.XMLHTTP");
}
//2. Link to the server (open the connection to the server)
//open(method, file name, asynchronous transmission)
oAjax.open('GET',url,true);
//3.Send
oAjax.send();
//4.Receive return
oAjax.onreadystatechange=function()
{
If (oAjax.readyState==4)
{
If(oAjax.status==200)
through fnSucc(oAjax.responseText);
}
else
through fnFaild(oAjax.status);
}
};
};
}
The requested file is read.txt
Fill in the content as you like