I've tested the problem in Firefox 2.0.0.14 using Firebug 1.05 and also in Firefox 3.0 using Firebug 1.2.0b4 and found the following results:
FF 2.0.0.14-Firebug 1.05
Tested the following code
Code:
for (var a=496; a>0; a--) {
setTimeout("remove(a)", 2000);
}
It shown an error - "a is not defined" from starting to the loop to the end.
FF 3.0-Firebug 1.2.0b4
Tested the following code
Code:
for (var a=496; a>0; a--) {
setTimeout("remove(a)", 2000);
}
When I tried to log the value of a from the remove function it simply shown it as "0" in all the iteration of the loop.
I've chanaged the code a bit and tested it:
FF 2.0.0.14-Firebug 1.05
Tested the following code
Code:
for (var a=496; a>0; a--) {
setTimeout("remove("+ a +")", 2000);
}
When I tried to log the value of "a" from the remove function, it correctly displayed the value of "a" that.
FF 3.0-Firebug 1.2.0b4
Tested the following code
Code:
for (var a=496; a>0; a--) {
setTimeout("remove("+ a +")", 2000);
}
When I tried to log the value of "a" from the remove function, it correctly displayed the value of "a" that.
Hope this helps.
Bookmarks