remove support for IE5 and IE6

This commit is contained in:
Gnieark 2016-05-28 14:55:30 +02:00
parent 7b3a0bf5ce
commit aac359c9d5

View File

@ -50,28 +50,6 @@ var grid=[["","","","","","",""],
["","","","","","",""]]; ["","","","","","",""]];
var currentPlayer=1; var currentPlayer=1;
function Ajx() {
var request = false;
try {
request = new ActiveXObject('Msxml2.XMLHTTP');
}
catch (err2) {
try {
request = new ActiveXObject('Microsoft.XMLHTTP');
}
catch (err3) {
try {
request = new XMLHttpRequest();
}
catch (err1) {
request = false;
}
}
}
return request;
}
function createElem(type,attributes){ function createElem(type,attributes){
var elem=document.createElement(type); var elem=document.createElement(type);
for (var i in attributes) for (var i in attributes)
@ -122,10 +100,9 @@ function play(player){
var symbol="O"; var symbol="O";
} }
var xhr = Ajx(); 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) {
var response=xhr.responseText; var response=xhr.responseText;
var t = new RegExp('^[0-6]$'); var t = new RegExp('^[0-6]$');
if (t.test(response)){ if (t.test(response)){
@ -133,8 +110,7 @@ function play(player){
}else{ }else{
alert ('la reponse du bot doit etre un digit compris entre 0 et 7, correspondant à la colonne. Voici sa réponse: "' + response + '"' ); alert ('la reponse du bot doit etre un digit compris entre 0 et 7, correspondant à la colonne. Voici sa réponse: "' + response + '"' );
} }
}else{ }else{
alert (xhr.status); alert (xhr.status);
die; die;
} }