fix var name

This commit is contained in:
gnieark 2016-06-03 11:59:46 +02:00
parent 1ee748e472
commit ca56fab131

View File

@ -139,7 +139,7 @@ function play(player){
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(){if(xhr.readyState == 4){ xhr.onreadystatechange = function(){if(xhr.readyState == 4){
if(xhr.status == 200) { if(xhr.status == 200) {
addLog('message send to bot ' + p + ':' + stringToSend); addLog('message send to bot ' + player + ':' + stringToSend);
addLog('his awnser is: ' + xhr.responseTEXT); addLog('his awnser is: ' + xhr.responseTEXT);
var reponse = eval(xhr.responseTEXT); var reponse = eval(xhr.responseTEXT);
@ -148,18 +148,18 @@ function play(player){
//test format of response //test format of response
var reg = '/^[0-2]\-[0-2]$/'; var reg = '/^[0-2]\-[0-2]$/';
if (!reg.test(cellTarget)){ if (!reg.test(cellTarget)){
addLog('player ' + p + ' a fait une réponse non conforme: ' + xhr.responseTEXT); addLog('player ' + player + ' a fait une réponse non conforme: ' + xhr.responseTEXT);
return; return;
} }
playingAT(cellTarget); playingAT(cellTarget);
}else{ }else{
addLog('player ' + p + ' n est pas joignable ' + xhr.status); addLog('player ' + player + ' n est pas joignable ' + xhr.status);
return; return;
} }
}}; }};
xhr.open("POST", document.getElementById('url' + p).value, true); xhr.open("POST", document.getElementById('url' + player).value, true);
xhr.setRequestHeader("Content-Type", "application/json"); xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(stringToSend ); xhr.send(stringToSend );