Passing object as parameter in Javascript
<p>I got this</p>

<pre><code>for(m in _data.data)
    {
        var _person= new Person(_data.data[m].Properties); //return a person object
        $('ul.v_list').append("&lt;li&gt;"+_person.person_name+'&lt;/li&gt;').css("cursor", "pointer");

        $('ul.v_list').find('li:last').bind('click', function(){onPersonChanged(_person)});
    }
</code></pre>

<p>And this another function</p>

<pre><code> function onPersonChanged(person){
        alert("You have clicked " + person.person_name);
   };
</code></pre>

<p>Everytime is passing the last object created in the Person Object to the <code>onPersonChanged</code> function so it alerts the last name in the list if I click in the first <code>li</code> or another <code>li</code> element nested in the <code>ul</code>. eg.: </p>

<pre><code>&lt;ul class='v_list'&gt;
     &lt;li&gt;James&lt;/li&gt;
     &lt;li&gt;Paul&lt;/li&gt;
     &lt;li&gt;Bonnie&lt;/l&gt;
&lt;/ul&gt;
</code></pre>

<p>When I do a click in Paul I expect an alert showing "You have clicked Paul" instead I always  get the last one li in the list: "You have clicked Bonnie". How can I get the correct alert for the selected <code>li</code>?</p>
