I am using AJAX and I'm getting the data from the database as Javascript variables. Now, in a table, I want to print an image using php base_url. The problem is the image is not showing. Here is my code: everything is printing except the picture
<script>
$(function(){
showAllEmployee();
function showAllEmployee(){
$.ajax({
type: 'ajax',
url: '<?php echo site_url('Welcome/showAllEmployee') ?>',
async: false,
dataType: 'json',
success: function(data){
var html = '';
var i;
for(i=0; i<data.length; i++){
html +='<tr>'+
'<td> <img class="size1" src="<?php echo base_url("/uploads/university/data[i].image")?>" /></td>'+
'<td>'+data[i].name+'</td>'+
'<td>'+data[i].division+'</td>'+
'<td>'+data[i].location+'</td>'+
'<td>'+data[i].min_hsc+'</td>'+
'<td>'+data[i].ad+'</td>'+
'<td>'+data[i].email+'</td>'+
'</tr>';
}
$('#showdata').html(html);
},
error: function(){
alert('Could not get Data from Database');
}
});
}
}
)
</script>