0
I have Mum problem to solve in my code where is appearing the following error :ERR_FILE_NOT_FOUND what can be ? I’m trying to create the old game
var vez = 'o';
function atualizarPlacar(){
if (vez == 'o'){
$('.placar img').attr('src', 'o.png');
}else{
$('.placar img').attr('src', 'x.png');
}
}
$(function(){
atualizarPlacar();
$('.area').bind('click', function(){
if($(this).find('img').length == 0 ){
if(vez == 'o'){
$(this).html('<img src="o.png" border="0" height="50" />');
$(this).attr('data-marcado', 'o');
vez = 'o';
}else {
$(this).html('<img src="x.png" border="0" height="50" />');
$(this).attr('data-marcado', 'x');
vez= 'x';
}
atualizarPlacar();
}
});
})
.area {
width: 80px;
height: 65px;
border: 2px solid #000;
float: left;
text-align: center;
padding-top:15px;
}
.placar {
width: 252px;
height: 80px;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<body>
<div class="placar">
É a vez de:<br/>
<img src="" border="0" height="50" />
</div>
<div class="area a1" data-marcado=""></div>
<div class="area a2" data-marcado=""></div>
<div class="area a3" data-marcado=""></div>
<div style="clear:both"></div>
<div class="area b1" data-marcado=""></div>
<div class="area b2" data-marcado=""></div>
<div class="area b3" data-marcado=""></div>
<div style="clear:both"></div>
<div class="area c1" data-marcado=""></div>
<div class="area c2" data-marcado=""></div>
<div class="area c3" data-marcado=""></div>
<script src="js/script.js"></script>
Where are the images o.png and x.png?
– André Lins
It is searching for the image o.png and x.png in the /Jquery/Jogodavelha/ folder. Probably the way is wrong. You should change to the right way in the Update function. If you can’t, please post a print of your project structure.
– lvr7