jQuery identifer from an href
<p>I was wanting to get the id from a series of hrefs...
I got the answers I was looking for - however they do NOT work in the context of my existing code - </p>

<p>The "delete confirm" and "edit dialog call" BOTH work in jsFiddle <a href="http://jsfiddle.net/RK4Ye/" rel="nofollow">http://jsfiddle.net/RK4Ye/</a> - BUT NOT when the links are generated thru jQuery.... I don't know what the cause is...but I've removed ALL other js, and these don't work... other pieces of info - the page runs as a tab in jQueryUI tabs...</p>

<p>HELP PLZ.. I don't even know how to find the problem, all the code works previous to the addition of those two features...
and no errors are being thrown....</p>

<p>THE ISSUE: is that both the edit link and the delete link take you to the href, the class selector does NOT catch the click event and stop the request...  (I realize the ajax call will make it impossible to totally duplicate the behavior - but take my word it's returning and functioning properly - but I'll include a JSON packet in case)</p>

<pre><code>$( function() {

function loadTable() {
    $.ajax({
        type: 'POST',   
        url: 'list.php',    
        dataType: 'json',   
        success: function ( data ) {                
            var items = [];
            var line = 1;

            // clear the table
            $( '#companies-list' ).html( '' );


            // the real data
            $.each( data.companies, function ( key, value ) {   
                var thisRowClass = 'odd';
                if ( line % 2 ) {
                    thisRowClass = 'even';
                }
                items.push( '&lt;tr class="' + thisRowClass + '"&gt;&lt;td nowrap&gt;'  + value.company + 
                            '&lt;/td&gt;&lt;td&gt;' + value.address + 
                            '&lt;/td&gt;&lt;td&gt;' + value.city + 
                            '&lt;/td&gt;&lt;td&gt;' + value.state + 
                            '&lt;/td&gt;&lt;td&gt;' + value.zip + 
                            '&lt;/td&gt;&lt;td nowrap&gt;' + value.phone + 
                            '&lt;/td&gt;&lt;td&gt;' + value.contact + 
                            '&lt;/td&gt;&lt;td&gt;' + value.email + 
                            '&lt;/td&gt;&lt;td&gt;' + value.jobscurrent + 
                            '&lt;/td&gt;&lt;td&gt;' + value.jobsdone + 
                            '&lt;/td&gt;&lt;td nowrap&gt; &lt;a href="m/company.php"  data-identity="' + value.id + '" class="uLink"&gt;edit&lt;/a&gt; |  &lt;a href="m/company.php?d=' + value.id + '" class="dLink"&gt;delete&lt;/a&gt; ' +
                            '&lt;/td&gt;&lt;/tr&gt;' ); 
                line++ ;
            }); 

            $( '#companies-list' ).append( items.join( '' ) );                                 

        },

        error: function () {    
            // there's an error
            $( '#message' ).html( '&lt;p&gt;There was a problem on the server... &lt;/p&gt;' ); 
        }
    });
}


// pre load my list when page loads
loadTable();



// DELETE CONFIRM
$( '.dLink' ).click( function( event ) {
    var response = confirm( 'Are you sure you want to delete this item?' );
    //the following is the tertiary version of: if (response) { return true; } else { return false; }
    return( response ) ? true : false;
});


// EDIT DIALOG CALL     
$( '.uLink' ).click( function() {
    var id = $( this ).data( 'identity' );
    alert( id );

    return false;
});

});
</code></pre>

<p>the HTML looks like this</p>

<pre><code>&lt;div id="companies-container" class="ui-widget"&gt;
&lt;h3&gt;List of Companies&lt;/h3&gt;
&lt;table id="companies" class="ui-widget ui-widget-content list"&gt; 
&lt;thead&gt;
    &lt;tr class="ui-widget-header "&gt;
        &lt;th&gt;Company&lt;/th&gt;
        &lt;th&gt;Address&lt;/th&gt;
        &lt;th&gt;City&lt;/th&gt;       
        &lt;th&gt;State&lt;/th&gt;
        &lt;th&gt;Zip&lt;/th&gt;
        &lt;th&gt;Phone&lt;/th&gt;
        &lt;th&gt;Contact&lt;/th&gt;
        &lt;th&gt;Email&lt;/th&gt;      
        &lt;th&gt;Jobs Current&lt;/th&gt;
        &lt;th&gt;Jobs Done&lt;/th&gt;
        &lt;th&gt;&amp;nbsp;&lt;/th&gt;
    &lt;/tr&gt;
&lt;/thead&gt;

&lt;tbody id="companies-list"&gt; 
&lt;/tbody&gt;

&lt;tfoot&gt; 
&lt;/tfoot&gt;
&lt;/table&gt;
&lt;/div&gt;
</code></pre>

<p>A sample JSON packet:</p>

<pre><code>{ "count": "3", "companies": [{ "id":"2", "company":"Main Customer A", "address":"1234 street ", "city":"Gallatin", "state":"TN", "zip":"30766", "phone":"", "contact":"", "email":"", "jobscurrent":"", "jobsdone":"" },{ "id":"3", "company":"Sub Customer B", "address":"232 road ", "city":"Galatan ", "state":"TN", "zip":"60766", "phone":"", "contact":"", "email":"", "jobscurrent":"", "jobsdone":"" },{ "id":"4", "company":"Sub Customer C", "address":"333 pkwy ", "city":"Nashville", "state":"TN", "zip":"37204", "phone":"", "contact":"", "email":"", "jobscurrent":"", "jobsdone":"" } ] }
</code></pre>
