I’m reading DOM Scripting by Jeremy Keith and testing the code in jsLint
- In the code sample here it i’m getting an error that says “”Don’t make functions within a loop”.
- When I try to fix it, I seem to be losing the scope of this
- I need to see an example of how to fix this error.
- Here is the jsfiddle: http://jsfiddle.net/pkdsleeper/ejvMj/
Thanks In Advance
sleeper
One way to do it is like this where you define local functions outside the loop:
Working in a jsFiddle: http://jsfiddle.net/jfriend00/aKfWs/.