Hi. I'm trying to use render to display an Image, but it's not working. My ideia is: In the field 4, if the field 8 isn't empty, show field 4 + image from field 8.
This is my code:
$(document).ready(function() {
$('#example').dataTable( {
"processing": true,
"serverSide": true,
"ajax": {
"url": "proc_flights.php",
"type": "POST"
},
"columnDefs": [ {
"targets": 4,
"render": function ( data, type, full, meta ) {
if (full[8]!='') {
return '<img src="'+full[8]+'" />';
} else {
return data;
}
}
} ]
} );
} );
Field 8 are returning 'TAM.png', but my brownser tries to get this URL:
http://radar.jonis.com.br/%27+full%5B8%5D+%27
If I just 'return full[8]', I got 'TAM.png' on my tables (this is correct), so the data is correct. What I'm doing wrong? I'm using XHTML.
Tks