title: Using Jquery in Codeigniter app to update div every 10 seconds
body: <p>I'm fooling around with a codeigniter 2.X app and I'm trying to use the following Jquery code to update a number every 10 seconds in my view. </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var auto_refresh = setInterval(
  function ()
  {
  $('#load_score').load('&lt;?php echo $FighterOneScore; ?&gt;').fadeIn("slow");
  }, 10000); // refresh every 10000 milliseconds
  
  &lt;/script&gt;
  </code></pre>
  
  <p>And this is my div tag in my view</p>
  
  <pre><code>&lt;div id="load_score"&gt; &lt;/div&gt;
  </code></pre>
  
  <p>UPDATE</p>
  
  <p>Here is my controller code
      
  
  <pre><code>public function left()
  {
      $this-&gt;load-&gt;model('points');
          $data['ScoreOne'] = $this-&gt;points-&gt;get_ScoreOne();
          echo $data['ScoreOne'];
  }
  
      public function right()
  {
      $this-&gt;load-&gt;model('points');
          $data['ScoreTwo'] = $this-&gt;points-&gt;get_ScoreTwo();
          echo $data['ScoreTwo'];
  }
  }
  ?&gt;
  </code></pre>
  
  <p>Here is the Javascript I have in My VIEW:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var auto_refresh = setInterval(
  function ()
  {
  $.get("&lt;?php echo base_url(); ?&gt;response/left",
  function(data){ $("#load_score").html($data); } // not sure about fadeIn here!
  );
  }, 10000); // refresh every 10000 milliseconds
  
  &lt;/script&gt;
  </code></pre>
  
  <p>When I load my view in the browser - The page shows nothing.</p>