title: jquery and ajax in codeigniter
body: <p>I just want to display a content from database when click a button in codeigniter,</p>
  
  <p>here is my script</p>
  
  <pre><code>function check()
  {
  
      var base_url="&lt;?php echo base_url();?&gt;"; 
      $.ajax({
      url :  base_url+"/seller/getSubCategory", success : function(data)
      {$('#content').html(data);}});
  }
  </code></pre>
  
  <p>in controller.php</p>
  
  <pre><code>public function getSubCategory()
      {
          $data['result']=$this-&gt;propertydetails-&gt;getPropertyCategories();
          $this-&gt;load-&gt;view('seller/postdetails',$data);
      }
  </code></pre>
  
  <p>and here is model.php</p>
  
  <pre><code>&lt;?php
  class propertydetails extends CI_Model
  {
      function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;database();
      }   
      function getPropertyCategories()
      {
          $query=$this-&gt;db-&gt;get('orx_categories');
          if($query-&gt;result()&gt;0)
          {
              return $query-&gt;result();
          }
          else 
          {
              return $query-&gt;result();
          }   
      }
  }
  
  ?&gt;
  </code></pre>
  
  <p>when i run this code nothing is happening, it doesn't show any errors, and it returns nothing.
  help me to solve this?</p>