title: codeigniter "No direct script access allowed"
body: <p>even i have added "if ( ! defined('BASEPATH')) exit('No direct script access allowed'); " on top of controller .Actually I need to display data in div 
  my ajax call:
  below is ajax call which calls Createcaptcha to get data but instead of data it response "No direct script access allowed"</p>
  
  <pre><code> $(document).ready(function(){
          $.ajax({
              type: "POST",
              url: 'website/Createcaptcha',
              success: function(data){
                  $("#captcha").html(data); 
              }
          });
  
      });
  </code></pre>
  
  <p>below is controller</p>
  
  <pre><code> public function Createcaptcha(){               
          $image = $this-&gt;captcha_model-&gt;create_image();
    echo $image;
  
      }
  </code></pre>
  
  <p>Response data is displayed in div as "No direct script access allowed" ,
  It works fine on  xampp localhost</p>