title: Load table using AJAX calls in Codeigniter
body: <p>I have three view files in views folder  and i want to show category table and product table by click in link button using ajax call... 
  <code>input.php</code> display both table data</p>
  
  <pre><code>&lt;div class="wrapper"&gt;
      &lt;div class="container"&gt;
          &lt;div class="jumbotron"&gt;
           &lt;h1&gt;View Two Records By Click Event&lt;/h1&gt;
          &lt;/div&gt;
  
      &lt;div id="show-catg"&gt;  
          &lt;?php $this-&gt;load-&gt;view('show'); ?&gt; 
      &lt;/div&gt;  
  
      &lt;div id="show-prd"&gt;  
           &lt;?php $this-&gt;load-&gt;view('show_pro'); ?&gt; 
      &lt;/div&gt; 
  </code></pre>
  
  <p>but i want to show this using click event.. like</p>
  
  <pre><code>&lt;a href="" class="show_catg"&gt;Categories&lt;/a&gt; 
  &lt;a href="" class="show_prd"&gt;Product&lt;/a&gt;
  $('.show_catg').click(function(){
    url:,
    data:,
  });
  $('.show_prd').click(function(){
    url:
    data:
  });
  </code></pre>
  
  <p>this is may controller class function</p>
  
  <pre><code>  public function index(){  
      $data= $this-&gt;Model_data-&gt;getAll_categories();  
      $data1 = $this-&gt;Model_data-&gt;getAll_product();
      $Dataa = array('categories' =&gt; $data,"products"=&gt;$data1);
      $this-&gt;load-&gt;view('input',$Dataa); 
  
    }
  </code></pre>
  
  <p>Model_data class</p>
  
  <pre><code>  function getAll_categories(){  
      $this-&gt;db-&gt;select('*');  
      $this-&gt;db-&gt;from('categories');  
      $this-&gt;db-&gt;limit(50);  
      $this-&gt;db-&gt;order_by('Catg_ID','ASC');  
      $query = $this-&gt;db-&gt;get();  
  
      return $query-&gt;result();  
    }  
  public function getAll_product(){  
      $this-&gt;db-&gt;select('*');  
      $this-&gt;db-&gt;from('product');  
      $this-&gt;db-&gt;limit(50);  
      $this-&gt;db-&gt;order_by('Prod_ID','ASC');  
      $query = $this-&gt;db-&gt;get();  
  
      return $query-&gt;result();  
    } 
  </code></pre>