The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Annoying jQuery Issue Re: Annoying jQuery Issue


It is just a typo, or is that really missing a “$”?

$("#p" + currentSlide).attr("src", "img/dot-empty.png");

If that was just a typo, then add a check to make sure the element exists, like this:

var p = $("#p" + currentSlide);
if (p.length){
p.attr("src", "img/dot-empty.png");