0
<script type="text/javascript">
function atualizarTarefas() {
var url = "institucional";
jQuery("institucional#entregas").load(url);
}
setInterval("atualizarTarefas()", 1000);
</script>
0
<script type="text/javascript">
function atualizarTarefas() {
var url = "institucional";
jQuery("institucional#entregas").load(url);
}
setInterval("atualizarTarefas()", 1000);
</script>
0
It’s simple:
On your call load
in Javascript use the function site_url()
from the Url helper to pass the correct link to the controller function.
Javascript
$("#minha_div").load("<?=site_url('institucional/tarefas/')?>");
Controller
class Institucional extends CI_Controller {
public function tarefas() {
echo "Seu conteúdo";
}
}
or
class Institucional extends CI_Controller {
public function tarefas() {
$this->load->view("listagem_tarefas");
}
}
https://www.codeigniter.com/user_guide/helpers/url_helper.html
thanks! Even Valew worked out here
Browser other questions tagged php jquery ajax codeigniter
You are not signed in. Login or sign up in order to post.
Go need to ajax
– rray
could give an example?
– Rafael gustavo
Ajax request with pure Javascript without Apis or with jquery
– rray
@Magichat This question is a little different because of the context Code Igniter. The answer is simpler than in the question marked.
– user26552