That's because {} in javascript doesn't create scope, so you're always capturing the same lexical scope (the same/i/ variable) when creating a closure inside the for, that's why/i/ has the.length value, if you do "i = 0" after the for you're changing also the/i/ captured in the closures you've created because it's the same variable. the only thing that creates a new lexical context in javascript is a function call so you can alternatively write:
for (var i = 0; i < elements.length; i++) { (function(i) {
elements[i].onclick = function() { doSomething(i); } })(i) }
yeah, but that's what you're going to tell my mom when she finds a bug? mozilla isn't just for geeks anymore, it's for everyone who wants a better option to IE
That's because {} in javascript doesn't create scope, so you're always capturing the same lexical scope (the same /i/ variable) when creating a closure inside the for, that's why /i/ has the .length value, if you do "i = 0" after the for you're changing also the /i/ captured in the closures you've created because it's the same variable. the only thing that creates a new lexical context in javascript is a function call so you can alternatively write:
for (var i = 0; i < elements.length; i++) { (function(i) {
elements[i].onclick = function() { doSomething(i); }
})(i) }
That would be a more interesting subject!
http://www.lusoscreen.com/eng/index.htm
SCO hired Andy?
do you know how 'C' came up?..
Compatability
the last use i had for explorer was for downloading mozilla just after a windows install.
as you can see, IE is usefull!
yeah, but that's what you're going to tell my mom when she finds a bug?
mozilla isn't just for geeks anymore, it's for everyone who wants a better option to IE
nothing that mozilla's JavaScript debugger won't catch!
i actually play warcraft III and diablo II in linux with winex 2.1 with no problem at all!
As you can see in http://support.microsoft.com/default.aspx?scid=kb; EN-US;q239750
You just need to add/change some value in the registry and you'll be ok with "text/plain" content-type
there is a diference between "a single person at a time" and "can only be installed in one computer at a time"