jQuery: trying hook a function to the onclick when page loads
<p>I have seen a similar question,  <a href="http://stackoverflow.com/questions/1129983/jquery-trying-hook-a-function-to-the-onclick-when-dynamically-adding-a-dom-elem">HERE</a> and have tried that, but I can't seem to get it working.
Here is my code for dynamically generating table rows.</p>

<pre><code>for (var contribution = 0; contribution &lt; candidate.contributions.length - 1; contribution++) {
    var id = candidate.contributions[contribution].donor_id;
    var uid = candidate.contributions[contribution].user_id;

    $("#history-table").append(
        "&lt;tr onclick='" + parent.viewEngine.pageChange('public-profile', 1, id, uid) + ";&gt;" +
        "&lt;td class='img-cell'&gt;" +
        "&lt;img class='profile-avatar-small' src='/uploads/profile-pictures/" +
        candidate.contributions[contribution].image + "' alt='' /&gt;&lt;/td&gt;&lt;td class=''&gt;" +
        "&lt;h2&gt;" + candidate.contributions[contribution].firstname +
        " " + candidate.contributions[contribution].lastname + "&lt;/h2&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;" +
        "&lt;span class='contribution-description'&gt;" + candidate.contributions[contribution].contribution_description + "&lt;/span&gt;&lt;/td&gt;" +
        "&lt;td&gt;&lt;h3&gt;$" + formatCurrency(candidate.contributions[contribution].contribution_amount) + "&lt;/h3&gt;&lt;/td&gt;&lt;/tr&gt;");
}
</code></pre>

<p>This still executes the click event as soon as the page loads, which is not the desired behavior. I need to be able to click the tr to execute the click event.</p>
