xhr.send(data)成功后,我试图重新加载页面;
但是我认为失败了
var xhr = new XMLHttpRequest();
xhr.open('POST', "User/adde", true);
xhr.onload = function(){
if (xhr.status==403 || xhr.status==404) {
alert("ERROR LOADING 3-UPLOAD.PHP");
} else {
//alert(this.response);
}
};
xhr.send(data); // the data will send from here.
success: function(data){
if(data.success == true){ // if true (1)
setTimeout(function(){// wait for 5 secs(2)
location.reload(); // then reload the page.(3)
}, 5000);
}
}