I want to create a jQuery iterative timer. For this I wrote the following script:
$(document).ready(function(){
var t;
function x()
{
alert('x')
t = setTimeout("x()",1000);
}
x();
});
First time the function x() called successfully. But from the next function x() is detect as undefined. What could I do?
This is because you define x() in closure. Define x as global function. Or pass it as function, instead of string: