Ayuda con: net::ERR_FILE_NOT_FOUND
Publicado por Francisco (1 intervención) el 13/01/2017 20:56:06
Tengo ese mensaje en consola [s]net::ERR_FILE_NOT_FOUND[/s] y ya chece y los archivos estan bien en carpeta, son unas imagenes, pero me manda este error, pienso que el problema esta en la variable "imagenUser.src", pero ya intente de todo y no, les agradeceria su ayuda... aqui mi codigo
---------------------------------------Aqui el js-----------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html lang="es-Mex">
<head>
<meta charset="UTF-8">
<title>Stone, paper, scissors, lizard, spock!</title>
</head>
<body>
<h1>You will play this traditional game</h1>
<p>Tell me your name and your desicion</p>
<form>
<label for="nombre">Put Your Name</label>
<input type="text" name="nombre" id="name" /> <br/>
<label for="desicion">What do you choose, stone, paper, scissors, lizard or spock</label>
<input type="text" name="desicion" id ="usero" >
<br/>
<input type="button" name="datos" id="dates" value="Accept" />
<p id="demo"></p>
<p id="res"></p>
</form>
<script type="text/javascript" src="lizard.js"></script>
</body>
</html>
---------------------------------------Aqui el js-----------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var opciones = [];
opciones.push("img/piedra.png");
opciones.push("img/papel.png");
opciones.push("img/tijeras.png");
opciones.push("img/lagarto.png");
opciones.push("img/spock.png");
var user = document.getElementById("usero");
var nombre = document.getElementById("name");
var ok = document.getElementById("dates");
ok.addEventListener("click", capturar);
var opcionJs = limite(0,4);
var imagenJs = new Image();
var imagenUser = new Image();
imagenJs.src = opciones[opcionJs];
imagenUser.src = opciones[user.value];
function limite(min, max) {
var num = Math.floor( Math.random() * (max - min + 1) + min);
return num;
}
function capturar() {
document.getElementById("demo").innerHTML = nombre.value + " Eligiste " + user.value;
document.body.appendChild(imagenUser);
document.getElementById("res").innerHTML = "Javascript eligio " + opcionJs;
document.body.appendChild(imagenJs);
}
Valora esta pregunta
0