title: How to load view on tabs from another page in code igniter
body: <p>I want to load data from another page using tabs in code igniter. 
  this is my code in views and controller. but still didn't work.</p>
  
  <p>Views:</p>
  
  <pre><code>&lt;ul id="mytabs" class="nav nav-tabs nav-fill" role="tablist"&gt;
      &lt;li class="nav-item"&gt;
          &lt;a class="nav-link active" data-toggle="tab" href="#data-company" role="tab" aria-expanded="true"&gt;&lt;span class="badge badge-pill badge-info"&gt;1&lt;/span&gt; Data Company&lt;/a&gt;
      &lt;/li&gt;
      &lt;li class="nav-item"&gt;
          &lt;a id="actDir" class="nav-link" data-toggle="tab"  role="tab" aria-expanded="false"&gt;&lt;span class="badge badge-pill badge-info"&gt;2&lt;/span&gt; Direksi &amp; Komisaris&lt;/a&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;div class="tab-content"&gt;
  
      &lt;div class="tab-pane fade" id="data-direksi" role="tabpanel" aria-expanded="false" style="background-color: transparent;"&gt;
          &lt;span id="content_direksi"&gt;&lt;/span&gt;
      &lt;/div&gt;
  
      &lt;script&gt;
      $("#actDir").click(function(){
  
          $.ajax({
              url: '&lt;?php echo site_url()?&gt;aktivasi_user/load_direksi/',
              dataType:'json',
              success:function(data){
                  // console.log(data.direksi);
                  $("#data-direksi").html(data.direksi);
              }
          });
  
      });
  
      &lt;/script&gt;
  </code></pre>
  
  <p>Controllers:</p>
  
  <pre><code>function load_direksi(){
          $dt = $this-&gt;load-&gt;view('aktivasi_user/direksi_komisaris');
          echo json_encode(array('direksi' =&gt;$dt));
  }
  </code></pre>