Timeline for Set of jQuery .onclick functions
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 16, 2013 at 12:56 | review | First posts | |||
| May 16, 2013 at 14:14 | |||||
| May 16, 2013 at 12:54 | comment | added | Claudio Redi |
@crm: it's the magic of closures :) Here you have a SO popular question that may clarify this topic stackoverflow.com/questions/111102/…. j in the parenthesis at the end is the way to call the function I just defined with parameter j
|
|
| May 16, 2013 at 12:44 | comment | added | crmepham |
How does i hold the value? Shouldn't you be calling j within the loop? also why is j in the parenthesis at the end like that?
|
|
| May 16, 2013 at 12:41 | comment | added | Claudio Redi |
@crm: inside the loop I'm defining a function that gets a number as parameter. Inmediatly after defining the function, I'm calling it trough this statement (j). This is a closure.
|
|
| May 16, 2013 at 12:37 | comment | added | crmepham | Hi, could you explain what is happening in that for loop? | |
| May 16, 2013 at 12:36 | history | answered | Claudio Redi | CC BY-SA 3.0 |