Rewriting A Part of My Code
<p>I'm trying to come up with a better way of accomplishing a task. I have about 30 different data tables. One for each module and they ALL share a button with a class of edit. The edit button takes the id of the button which is the DB id row and takes it to the module's edit form page. So keeping all of this in mind to prevent bubbling and all other else. Does anyone know a better way to write this.</p>

<p>This is just an example of how one is written.</p>

<pre><code>$('.edit').live('click', function(e) {
    e.preventDefault();
    var templateID = $(this).attr('id');
    if(!$('div.right_content').hasClass("loading")){
        $('div.right_content').addClass("loading").load('modules/forms/edit/templates.php?templateID=' + templateID, 
        function() {
            $(this).removeClass("loading");
        });
    }
});
</code></pre>

<p>EDIT: </p>

<pre><code>  &lt;table id="templatesPageList" class="rounded-corner dataTablePageList"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th scope="col" class=""&gt;&lt;/th&gt;
        &lt;th scope="col" class=""&gt;ID&lt;/th&gt;
        &lt;th scope="col" class=""&gt;Description&lt;/th&gt;
        &lt;th scope="col" class=""&gt;Edit&lt;/th&gt;
        &lt;th scope="col" class=""&gt;Delete&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;input type="checkbox" name="templates" value="1" /&gt;&lt;/td&gt;
        &lt;td&gt;1&lt;/td&gt;
        &lt;td&gt;Main Site Template&lt;/td&gt;
        &lt;td&gt;&lt;a href="#"&gt;&lt;img src=
        "http://www.kansasoutlawwrestling.com/manager/images/user_edit.png" class="edit"
        alt="" title="" border="0" id="1" name="1" /&gt;&lt;/a&gt;&lt;/td&gt;
        &lt;td&gt;&lt;a href="#" class="ask"&gt;&lt;img src=
        "http://www.kansasoutlawwrestling.com/manager/images/trash.png" class="delete"
        alt="" title="" border="0" id="1" name="1" /&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;input type="checkbox" name="templates" value="2" /&gt;&lt;/td&gt;
        &lt;td&gt;2&lt;/td&gt;
        &lt;td&gt;Event Page&lt;/td&gt;
        &lt;td&gt;&lt;a href="#"&gt;&lt;img src=
        "http://www.kansasoutlawwrestling.com/manager/images/user_edit.png" class="edit"
        alt="" title="" border="0" id="2" name="2" /&gt;&lt;/a&gt;&lt;/td&gt;
        &lt;td&gt;&lt;a href="#" class="ask"&gt;&lt;img src=
        "http://www.kansasoutlawwrestling.com/manager/images/trash.png" class="delete"
        alt="" title="" border="0" id="2" name="2" /&gt;&lt;/a&gt;&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
</code></pre>
