-1
I’m having do with my site swap certain images, I created the following code, someone by chance can point out errors..?
<script type="text/javascript">
function ImgsRandom(){
var trocar=new Array()
trocar[0]='<img src="site.projeto/Logo_pilates.jpg" alt=""/>';
trocar[1]='<img src="site.projeto/equipamento.jpg" alt=""/>';
trocar[2]='<img src="site.projeto/equipamento_02.jpg" alt=""/>';
var whichtrocar=Math.floor(Math.random()*(trocar.length));
document.getElementById("imgsrandon").innerHTML = trocar[whichquote];
}
window.onload=ImgsRandom;
</script>
The browser already does this, just look at the console of the same that there will be possible error messages.
– Woss
Which error is reported by browser ?
– Leone Cerqueira