J
jman
i've got an object and i'd like to recursively call a function
within the class definition.
(i've simplified the code )
function myclass()
{
this.loop = function(index)
{
// ..work
setTimeout( "loop(" + (index+1) + ")", 100 );
}
}
does not work.
i've also tried
setTimeout( function() { loop(index+1) }, 100 );
i've also prefixed this. to loop in both cases - and no workee.
i think it's some sort of scope problem.
within the class definition.
(i've simplified the code )
function myclass()
{
this.loop = function(index)
{
// ..work
setTimeout( "loop(" + (index+1) + ")", 100 );
}
}
does not work.
i've also tried
setTimeout( function() { loop(index+1) }, 100 );
i've also prefixed this. to loop in both cases - and no workee.
i think it's some sort of scope problem.