How to make a change print in the view without refresh? [duplicate]

0
<script type="text/javascript">

  function atualizarTarefas() {
       var url = "institucional";
       jQuery("institucional#entregas").load(url);
   }
   setInterval("atualizarTarefas()", 1000);

</script>
    
asked by anonymous 16.02.2017 / 15:42

1 answer

0

It's simple:

In your call load in JavaScript use the site_url() function of 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");
    }
 }

link

    
16.02.2017 / 17:15