title: Auto refresh div in cakephp 2.4.x
body: <p>I want a auto refresh div in my view page in cakephp 2.4.x. The following are my code.
  Controller....</p>
  
  <pre><code>public function latestpost(){
      $this-&gt;set('posts',$this-&gt;Post-&gt;find('all',array('limit'=&gt;4)));
  }
  </code></pre>
  
  <p>In my view page index.ctp</p>
  
  <pre><code>&lt;div id="refesh"&gt;
    &lt;?php foreach($posts as $post):
            echo $post['Post']['topic'];
    ?&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>and my jquery code is </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   $(document).ready(function(){
    //var j = jQuery.noConflict();
   $(document).ready(function()
  {
      $("#refresh").everyTime(1000,function(i){
          $.ajax({
            url: "/my_app/posts/latestposts",
            cache: false,
            success: function(html){
              $("#refresh").html(html);
            }
          })
      })
  });
   $('#refresh').css({color:"green"});
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Only showing the data from the data base. Refreshing is not happening automatically...
  please any one help me....</p>