各位大牛,下面是我js文件,html文件就是一个按钮,调用ReadTxt()函数,但是xmlHttp.send(null)这句每次都报错。。。。。
如果把url改成本地的文件就没错,但是一改成服务器上的文件就会出错?恳请各位指教。。。。。。
var xmlHttp,txt;
function ReadTxt()
{
xmlHttp=new XMLHttpRequest();
if(xmlHttp){
xmlHttp.open("GET","http://sig-ds.caf.ac.cn:8080/SIGRE/fire/6327190396615241347.txt",false);
xmlHttp.onreadystatechange=processReqChange;
xmlHttp.send(null);
}
}
function processReqChange(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
txt = xmlHttp.responseText;
}
else{
alert("error:");
}
}
}