Passing a variable to another function in Javascript
<p>I asked a question a while back about how to get the current variable in a loop and I got the solution :</p>

<pre><code>    for (i in ...)
        {
        ...
          href:"javascript:on_click('+i+');"...}
</code></pre>

<p>When i run this, the loop is sending the on_click function the string 'i' instead of the value of i.
<br /> Am I using the <code>+variable+</code> wrong? Can someone explain in more detail what wrapping a variable in + means and why it is not working in my case?</p>
