0
I would like to pass the variable var data = 'codreq=' + id; for two ways. Is that possible? If so, someone can teach me. I can only go this way:
url: "<?= base_url('coordenador/protocolo/buscaDetalhesRequerimento') ?>"
I need to move to this one at the same time:
url: "<?= base_url('coordenador/protocolo/responder_requerimento') ?>"
<script>
$(document).ready(function ()
{
$("a#visualizar").click(function () {
var id = $(this).attr('data-id');
var data = 'codreq=' + id;
//alert(data);
$.ajax({
type: "POST",
url: "<?= base_url('coordenador/protocolo/buscaDetalhesRequerimento') ?>",
data: data,
success: function (text) {
//if (text === "success") {
$(".dados").html(text);
// });
//window.location.reload(true);
//}
}
});
});
});
Why not create a function and place this AJAX code inside it and then call it twice by passing the appropriate destination URL as parameter?
– Clayderson Ferreira
I’m trying to do like this, but the codeigniter is fucked, I’m hitting me!
– user55375
What appears in console.log when you call function
$("a#visualizar").click()
?– Thiago Santos