title: Cannot get ajax to work codeigniter
body: <p>I have the ajax code</p>
  
  <pre><code>      $.ajax({
       url: '&lt;?php echo base_url(); ?&gt;deleteRowUsingApiKey/index', //This is the current doc
       type: "POST",
       //dataType:'json', // add json datatype to get json
       data: {name: '145'},
       success: function(data){
           console.log(data);
           alert(data);
       }
  });
  </code></pre>
  
  <p>In the php controller</p>
  
  <pre><code>&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');
  error_reporting(E_ALL);
  ini_set('display_errors', 1);
  class DeleteRowUsingApiKey extends CI_Controller
  {
      function __construct()
      {
          parent::__construct();
      }
  
      function index()
      {
              echo json_encode('test');
  
      }
  }
  </code></pre>
  
  <p>I wanna get the value 'test' in the javascript.But i cant get this working</p>