I have an li
<li id="clientshowall"><a href="#"><span>Show All Clients</span>
// This Function retrieves all the Clients from my mysql database.
$(function(){
$("#clientshowall").on('click', function(){
$.ajax({
method: "GET",
url: "client_tables.php",
}).done(function( data ) {
var result= $.parseJSON(data);
var string='
customer Number | First Name | Last Name | Email Address | Cell Phone | '; /* from result create a string of data and append to the div */ $.each( result, function( key, value ) { string += "
---|---|---|---|---|
"+value['customer_number']+ " | " +value['first_name']+ " | " +value['last_name']+ " | " +value['email']+ " | " +value['primary_phone']+ " |
';
$("#payments").html(string);
});
});
});
See Attached of the table.
I would like to use datatables in the above function, but I do not know how to incorporate into this function. If some one caould give me a pointer I would be most appreciative.
thanks