title: Why this URL Error in Codeigniter/Ajax?
body: <p>I am building an App in Codeigniter framework.. I have an Ajax function in the view file which calls to Controller(Me) function(getUser).. But i have to change the URL parameter in Ajax function if i change the way of triggering that function.
  Code as follows</p>
  
  <p>Method 1</p>
  
  <pre><code>$('#project').click(function(){
          $.ajax({
              type: "POST",
              url: "me/getUser"  // Controller name is added before func name
          }).done(function( html ) {
              $(".dashboard-project").html(html);
          });
      });
  </code></pre>
  
  <p>Method 2</p>
  
  <pre><code>$('#project').click(function(){
      ajaxfunc123();
     });
  
   ajaxfunc123(){
     $.ajax({
        type: "POST",
        url: "getUser"    // Direct function called
        }).done(function( html ) {
             $(".dashboard-project").html(html);
        });
   }
  </code></pre>
  
  <p>Both the above method works..But i am troubled by why the change in URL is required if both function are on same page ?
  can somebody plz explain me the reason or is it that i am doing it wrong way ?</p>