problem with setTimeout "function is not define" !
What is the problem in this code ?
$(document).ready(function(){
function ISS_NextImage() { //ImageSlideShow NextImage
$('.ImageSlideShow').each(function() {
alert($(".correntImage", this).text());
});
}
var t=setTimeout("ISS_NextImage();",1000);
});
When you eval
code, it is done in the global scope. Since the function you are trying to call is locally scoped, this fails.
Pass the function to setTimeout
instead of passing a string to be eval
ed.
var t=setTimeout(ISS_NextImage,1000);
Try changing your set timeout call to this:
var t=setTimeout(function(){ISS_NextImage();},1000);
Avoid passing a string to setTimeout(). Just pass a reference to the function instead:
var t = setTimeout(IIS_NextImage, 1000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With