未定義在xhr帖子上返回。我不知道問題在哪裏返回屬性(XHR)上未定義
var d=new XMLHttpRequest();
var data;
d.open("POST",b,!0);
d.setRequestHeader("Content-type","application/json");
d.onreadystatechange=function(){
if(d.readyState==4){
var data={status:d.status,text:d.responseText};
return data.text; // this return undefined
}
};
d.send(c);