title: Codeigniter ajax post the action you requested is not allowed
body: <p>I'm trying to call the ajax once user had <code>onclick</code> on the button, then the button will be passing the id to the controller to output the result in my modal's div. However when I debug it show me the action you requested is not allowed.</p>
  <p>Is there anything I can do about it on my code?</p>
  <p><strong>View :</strong></p>
  <pre class="lang-html prettyprint-override"><code>&lt;input type=&quot;&quot; name=&quot;&quot; value=&quot;VIEW&quot; class=&quot;btn btn-primary m-t-15 waves-effect&quot; data-toggle=&quot;modal&quot; data-target=&quot;#defaultModal&quot; onclick=&quot;refresh_detail('.$row[&quot;Task_ID&quot;].')&quot;&gt;
  </code></pre>
  <p><strong>jQuery / AJAX Code:</strong></p>
  <pre class="lang-js prettyprint-override"><code>&lt;script type=&quot;text/javascript&quot;&gt;
    function refresh_detail(id){
      $.ajax({
        url : &quot;&lt;?= base_url()?&gt;admin/Admintask/get_task_detail&quot;,
        type : &quot;POST&quot;,
        dataType : &quot;json&quot;,
        data : {&quot;TaskID&quot; : id},
        success : function(data) {
          // do something
        },
        error : function(data) {
          // do something
        }
      });
    }
  &lt;/script&gt;
  </code></pre>
  <p><strong>Controller :</strong></p>
  <pre class="lang-php prettyprint-override"><code>public function get_task_detail(){
    echo $this-&gt;input-&gt;post('TaskID');
  }
  </code></pre>