jQuery adding a function to a link question
<p>I have a dynamically created table which in the last <code>&lt;td&gt;</code> there is a hidden <code>&lt;div&gt;</code> which is shown when the user hovers over a link in the <code>&lt;td&gt;</code>. That all works fine but there are several links in the div that I want to fire a function based on the id of the link concat'd with an string captured from a <code>&lt;td&gt;</code> from the parent row. I can capture the the variables I need from the id and <code>&lt;td&gt;</code> but something is wrong with the click function I have created. </p>

<p>I monitored the function in FireBug and the function appears to be firing on all of the links instead of the one that is clicked. Here is my working code:</p>

<pre><code>function fixLink() {
           $('a.batchMatchLink').click(
             function() {
                 var r = $(this).parent().parent().parent().parent().parent();
                 var x = $(this).attr("id");
                 var a = $(r).find('td:nth-child(6)').text();
                 var st = x + "." + a;
                 fireLink(st);
             }
            );
       }

       function fireLink(st) {
           $.ajax({
               type: "POST",
               url: "AjaxWcf.svc/MatchBatch",
               contentType: "application/json; charset=utf-8",
               data: st,
               dataType: "json",
               success: function(msg) {
                   alert("Entry has been updated");
                   },
               error: AjaxFailed

           });
</code></pre>

<p>Why are all of the links firing?</p>

<p>Thanks!!!</p>
