I have a code below, which display image name on UI by reading it from the folder where those images are uploaded,
These image names are displaying using a java-script template, I want to pass that name to a php function in order to check its status by hitting the db by the image name..
Here is how the image name is displaying in UI:
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download fade">
<td>
<span>{%=file.name%}</span>
<!----- new update -------->
var a= file.name;
$.ajax({
type: "POST",
url: "http://localhost/tripvioapp/trips/showStatus/",
dataType: "text",
data: {image_name: a,trip_id: '2'},
success: function(msg){
alert(msg);//how can i display this value in this place
}
});
</td>
</tr>
{% } %}
</script>
Basically, i have integrated file upload with Codeigniter(php framework) From this tutorial
What i tried so far
i tried passing {%=file.name%} as below
$this->tripmodel->getImageStatusByUidName('\"{%=file.title%}\"',"2"); //calling php function
Result: instead of passing value from{%=file.name%} , its passing as it is.
Expected (as it should work internally like this:)
$this->tripmodel->getImageStatusByUidName("imageName.jpg","2");
Can anyone help me with this,please?