loadData() function on codeigniter 3
<p>How to using JavaScript loadData function on CodeIgniter 3?
I have a transaction view that have detail items to be bought, I want to use loadData to load detail view.</p>

<p>This is my file structure:</p>

<pre><code>myproject:
 -application
   --controller
     ---admin
       -----dashboard.php
       -----transaction.php
     ---home.php
   --model
     ---mymodel.php
   --view
     ---transaction
       ----transaction_index.php &lt;- the view that I want to use for calling
       ----transaction_detail.php &lt;- the view that I want to call
     ---home.php
</code></pre>

<p>And my transaction_index main part:</p>

<pre><code>&lt;div id="t_detail"&gt;&lt;/div&gt;
</code></pre>

<p>Script</p>

<pre><code>$(document).ready(function(){
function loadData(args){
    $("#t_detail").load("&lt;?php echo base_url('admin/transaction/getDetail'); ?&gt;");
}
loadData();

function emptying(args){
    $("#id").val();
    $("#name").val();
    $("#category").val();
    $("#price").val();
    $("#total").val();
}
})
</code></pre>

<p>My transaction detail just contain table
And my controller</p>

<pre><code>public function getDetail(){
    $data['temporary'] = $this-&gt;mymodel-&gt;getAllData('temporary')-&gt;result();
    $data['limit'] = $this-&gt;mymodel-&gt;countAll('temporary');
    $this-&gt;load-&gt;view('transaction/transaction_detail', $data);
}
</code></pre>