@
lianyue 我是按书上的例子
function getNewContent(){
var request=getHTTPObject();
if(request){
request.open("GET",'example.txt', true );
request.onreadystatechange=function(){
if(request.readyState == 4){
alert('Response Received');
var para = document.createElement('p');
var txt = document.createTextNode(request.responseText);
para.appendChild(txt);
document.getElementById('new').appendChild(para);
}
};
request.send(null);
}
else{
alert('Sorry, your browser doesn\'t support XMLHttpRequest ');
}
alert('Function Done');
}
能正常弹出 Function Done 和 Response Received
但是 responseText 的值总是 null。。。。
js 萌新 见谅