title: How to make ajax request from codeigniter view
body: <p>I have a view </p>
  
  <pre><code>     &lt;script type="text/javascript"&gt;
  
  function ajax_articles() {
  
      $.ajax({
        url: "http://localhost/codeigniter/CodeIgniter_2.1.3/index.php/patientmain/search_doctor_by_name/"+$('#search')[0],
        async: false,
        type: "POST",
        data: "type=article",
        dataType: "html",
        success: function(data) {
          $('#ajax').html(data);
        }
  
    });
  
  }
  &lt;/script&gt;
  &lt;div class="content"&gt;
  &lt;div class="content-left"&gt;
  &lt;div  class="row1"&gt;
     &lt;h2&gt;Welcome &lt;? echo $username ?&gt;&lt;/h2&gt;
     &lt;form name="search"&gt;
     Search Doctor by name : &lt;input name="name" id="search" type="text" onChange="ajax_articles();"&gt;
     &lt;/form&gt;
     &lt;/div&gt;
  
     &lt;div id="ajax"&gt;
  
  
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="content-right"&gt;
  &lt;div class="mainmenu"&gt;
  &lt;h2 class="sidebar1"&gt;My Menu&lt;/h2&gt;
  &lt;p&gt;&lt;ul&gt;
    &lt;li&gt;&lt;a href="#"&gt;this is a dummy link 1&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;this is a dummy link 2&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;this is a dummy link 3&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;this is a dummy link 4&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;this is a dummy link 5&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;this is a dummy link 6&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;this is a dummy link 7&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;this is a dummy link 8&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;this is a dummy link 9&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="#"&gt;this is a dummy link 10&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;&lt;/p&gt;
  &lt;/div&gt;
  
  
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my view now i want to call the <code>http://localhost/codeigniter/CodeIgniter_2.1.3/index.php/patientmain/search_doctor_by_name</code> through this jquery ajax. But nothing is happening. No response is coming. I think there is some problem in the code can anyone please point out the problems.  Please suggest.
  Thanks</p>