Reputation: 589
I got this error on firefox errors debugger :
Error: TypeError: slidesArray[index] is undefined Source File: http://mydomain.com/hatem/scripts/slider.js
The code is built on jQuery as you see :
jQuery.each
(
slidesArray,function(index,value)
{
$("#slider").show();
var linkHref = slidesArray[index][1];
var imageSource = slidesArray[index][0];
alert(imageSource)
$("#slider").html
(
"<a href='" + linkHref + "'><img src='"+ imageSource + "'></a>"
).hide().fadeIn(5000);
$("#slider").hide();
}
);
Notes : The Array slidesArray checked by me and it is exist with several elements.
Thanks
Upvotes: 1
Views: 424
Reputation: 25165
Check the array slidesArray
. Try this to find out which index is undefined
jQuery(slidesArray).each(function(index, value) {
if (value && value.length) {
$("#slider").show();
var linkHref = value[1];
var imageSource = value[0];
alert(imageSource)
$("#slider").html("<a href='" + linkHref + "'><img src='" + imageSource + "'></a>").hide().fadeIn(5000);
$("#slider").hide();
} else {
alert("slidesArray[" + index + "] is invalid");
}
});
Upvotes: 1