asdfasdf
This commit is contained in:
parent
9c7c253ef1
commit
c316557c6d
1 changed files with 7 additions and 19 deletions
26
script.js
26
script.js
|
@ -94,40 +94,28 @@ function write_result(verif){
|
|||
}
|
||||
}
|
||||
|
||||
function readTextFile(file) //Merci StackOverflow
|
||||
{
|
||||
function readTextFile(file) { //Merci StackOverflow
|
||||
var rawFile = new XMLHttpRequest();
|
||||
rawFile.open("GET", file, false);
|
||||
rawFile.onreadystatechange = function ()
|
||||
{
|
||||
if(rawFile.readyState === 4)
|
||||
{
|
||||
if(rawFile.status === 200 || rawFile.status == 0)
|
||||
{
|
||||
rawFile.onreadystatechange = function (){
|
||||
if(rawFile.readyState === 4){
|
||||
if(rawFile.status === 200 || rawFile.status == 0){
|
||||
var allText = rawFile.responseText;
|
||||
arrWords=allText.split(/\r?\n/);
|
||||
}
|
||||
}
|
||||
}
|
||||
rawFile.send(null);
|
||||
|
||||
}
|
||||
|
||||
function verifWord() {
|
||||
|
||||
let exist = false;
|
||||
if (word.length == 5)
|
||||
{
|
||||
|
||||
for(let i = 0; i< arrWords.length;i++)
|
||||
{
|
||||
if(arrWords[i]==word)
|
||||
{
|
||||
if (word.length == 5){
|
||||
for(let i = 0; i< arrWords.length;i++){
|
||||
if(arrWords[i]==word){
|
||||
exist = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return exist;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue