This is a silly little question, I know, but I can't seem to find the answer to it...
I'm trying to change an image in Jquery using an array with the names, but it reads n, g and 2 instead of the actual values.
My code is:
var huidig = 1;
var arrayTekenen = jQuery.makeArray("peng1.png","peng2.png","peng3.png","peng4.png");
$(document).ready(
function() {
$('#next').bind('click', ClickNext);
}
)
function ClickNext() {
if(huidig<4)
{
huidig++;
}
$("#tekenstap").attr('src', 'img/' + arrayTekenen[huidig]);
}
This is the error I get when clicking the object:
Failed to load resource (15:27:28:901 | error, network) at http:// localhost:8383/HTML5Application/img/n Failed to load resource (15:27:30:048 | error, network) at http:// localhost:8383/HTML5Application/img/g Failed to load resource (15:27:30:729 | error, network) at http:// localhost:8383/HTML5Application/img/2
Thanks in advance.