title: Calling controller method using Ajax not working in Magento
body: <p>I am calling controller method using Ajax in my custom module. See my ajax call code-</p>
  
  <pre><code> var btnUpload=$('#upload');
      var status=$('#status');   
  
   new AjaxUpload(btnUpload, {
                          action:"&lt;?php echo getUrl('character/adminhtml_ajax/fileUpload') ?&gt;", /* module/controller/action */
                          name: 'uploadfile',
                          onSubmit: function(file, ext){
                               if (! (ext &amp;&amp; /^(jpg|png|jpeg|gif)$/.test(ext))){ 
  
                                  status.text('Only JPG, PNG or GIF files are allowed');
                                  return false;
                              }
                              status.text('Uploading...');
                          },
                          onComplete: function(file, response){
  
                              status.text('');
  
                              if(response==="success"){
                                  $('&lt;li&gt;&lt;/li&gt;').appendTo('#files').html('&lt;img src="./uploads/'+file+'" alt="" /&gt;&lt;br /&gt;'+file).addClass('success');
                              } else{
                                  $('&lt;li&gt;&lt;/li&gt;').appendTo('#files').text(response).addClass('error');
                              }
                          }
                      });
  </code></pre>
  
  <p>But it gives me HTML of <strong>system->configuration</strong> page in admin of magento in response and not calling controller method "<strong>fileUpload</strong>".</p>
  
  <p>this is my controller method-</p>
  
  <pre><code>&lt;?php
  
  class Assel_Character_Adminhtml_AjaxController extends Mage_Adminhtml_Controller_Action
  {
      public function fileUploadAction()
      {
          echo "this is controller method";
      }
  }
  </code></pre>
  
  <p>Why this is happening..?</p>