js gestion erreur ajax
This commit is contained in:
parent
8433823cd4
commit
2aff5db168
|
@ -18,6 +18,9 @@ function connectFour(bot1,bot2,xd_check){
|
||||||
xhr.onreadystatechange = function(){if(xhr.readyState == 4){
|
xhr.onreadystatechange = function(){if(xhr.readyState == 4){
|
||||||
if(xhr.status == 200) {
|
if(xhr.status == 200) {
|
||||||
document.getElementById('fightResult').innerHTML = xhr.responseText;
|
document.getElementById('fightResult').innerHTML = xhr.responseText;
|
||||||
|
}else{
|
||||||
|
alert ('error ' + xhr.status);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
xhr.open("POST", '/connectFour', true);
|
xhr.open("POST", '/connectFour', true);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user