0
I have a <a href="javascript:void(0);" class="justificar" data-value="<?= $l->img_id?>">
that when you click, I need you to bring a data from the database, but I don’t know how to pull this data to the screen. My code is codeigniter, and when you click on <a href>
he calls this class:
$(document).on('click','.justificar', function(){
var t = $(this);
$.SmartMessageBox({
title : "<?= $this->lang->line("con_inflaud_jus_msg_title"); ?>",
content : "<?= $this->lang->line("view_relat_iten_title_jus"); ?>",
buttons : "[<?= $this->lang->line("con_inflaud_jus_msg_btn_ok"); ?>]",
}, function(ButtonPress, Value) {
if(ButtonPress == "<?= $this->lang->line("con_inflaud_jus_msg_btn_ok"); ?>"){
return 0;
}
});
});
How do I bring the data from the database
wouldn’t it be better to use php to get it from the bank?
– RFL
What you’re looking for is an ajax call. You need to send a request to the server and treat it in codeigniter to bring your data and then vc recovers the return from ajax and displays the content
– Tafarel Chicotti
@Rafaelacioly and how I can call a controller function in javascript without using the window?
– Ketlin