I am requesting some help on my server-side processing jQuery script
What I need is to,
- Add td class,
- Get cell values,
- And change the cell styling
I am getting this error,
Uncaught SyntaxError: unexpected token: identifier
<script type="text/javascript">
$(document).ready(function() {
$("#contact-detail").dataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "scpp.php",
"type": "POST",
"dataType": "json"
},
rowCallback: function(row, data, index) { // get cells
$('#td_id').addClass('td_style'); // add td class
var currentRow = $(this).closest("tr"); // help to select the current row.
if (data[0]) { // for first cell
var col1 = $(row) currentRow.find("td:eq(0)").text(); // find first cell value
$(this).html('<a href="order.php?d=' + col1 + '" role="button" class="btn"> <span class="spinn" role="status"></span>>' + col1 + '</a>'); // make it look like this
}
if (data[1]) { // for second cell
var col2 = $(row) currentRow.find("td:eq(1)").text(); // find second cell value
$(this).html('<img src="img/' + col2 + '" class="image" alt="Trulli">'); // make it look like this
}
if (data[2]) { // for third cell
var col3 = $(row) currentRow.find("td:eq(2)").text(); // find third cell value
$(this).html('<i class="fa fa-user-circle-o"></i> ' + col3 + ' '); // make it look like this
}
}
});
}); <
</script>