title: auto refresh using jquery in codeigniter
body: <p>I'm trying to auto refresh using jquery. but my page won't reload by itself</p>
  
  <p>Here is my controller:
      
  
  <pre><code>class Count_controller extends CI_Controller {
    public function index() 
    { 
      $this-&gt;load-&gt;view('count_view', @a);
    }
  
    public function table()
    {
      $a = rand(1000, 5000);
      echo $a;
    }
  }
  </code></pre>
  
  <p>And here my view:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
        setInterval("auto_refresh_function();", 500);
          function auto_refresh_function() {
            $('#load_content').load('http://demo1.com/demo/count_controller/table');
          }
  &lt;/script&gt;
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;div id="load_content"&gt;Loading&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is my .htaccess:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond $1 !^(index\.php|static|js|css|gif|png|jpg|robots\.txt|html)
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php/$1 [L,QSA]
  </code></pre>
  
  <p>can somebody help me? </p>
  
  <p>thank you</p>