Passing a reference of a data collection into a click handler's callback function
<p>Here's how my code is structured at the time being:</p>

<pre><code>$.post('includes/getPeople.php', {char: character}, function(data) {
 var peopleData = data.people;

 //generation of HTML markup...

 $("#peopleTable a.nameLink").live("click", function(e) {
 var index = $(this).attr("title");
 console.log(peopleData[index].Email);
 alert(peopleData[index].Email);
 e.preventDefault();
    });
}
</code></pre>

<p>Whenever I click on a link (which is the name of the person in the database), I get this error: "peopleData is undefined". Is there a way I could fix this?</p>

<p>Thank you.</p>
