title: jquery ajax call not giving response in codeigniter
body: <p>I am trying jquery ajax in codeigniter for first time. I am not getting any response from ajax call. when I click button, I can verify data using alerts before j.ajax but no response to actual ajax call. Please help to find problem.</p>
  
  <p>My view is:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;script src="&lt;?php echo base_url(); ?&gt;js/jquery-latest.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script type="text/javascript"&gt;
  var j=jQuery.noConflict();
  j(document).ready(function(){
      j("#b").click(function(){
          var scode=j("#a").val();
          var baseurl="&lt;?php echo base_url(); ?&gt;";
          $.ajax({
           type: 'POST',
           url: baseurl + 'ajax/aj', 
           data: {txt:scode},
          success:function(response){
             j("#c").val(response);
           }
       });
      });
  });
  &lt;/script&gt;
  &lt;form id="form1" name="form1" method="post" action=""&gt;
    &lt;label for="a"&gt;&lt;/label&gt;
    &lt;input type="text" name="a" id="a" /&gt;
    &lt;input name="b" type="button" value="click" id="b" /&gt;
    &lt;input type="text" name="c" id="c" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my controller is:</p>
  
  <pre><code>&lt;?php
  class ajax Extends CI_Controller{
      public function __construct()
      {
      parent::__construct();  
      $this-&gt;load-&gt;helper('url');
      }
      public function index(){
          $this-&gt;load-&gt;view('ajax_trial');
      }
      public function aj(){
          $x=$this-&gt;input-&gt;get('txt');
          echo $x;
      }
  }
  ?&gt;
  </code></pre>