title: On submit keeps loading but not returning data
body: <p>I have created a form for making donation when user makes donation he will be viewing an error or if successful will be able to see a form on second page like second form will be loaded up. Now the problem is that when I tested data is properly updating in the database as well as on back end everything is working fine. The problem is that ajax is not getting return data I have placed a loader on success the loader will be hidden and it is not working it's continuously loading but not getting return data can anyone help me out to fix this error for me please here is my code</p>
  
  <p>This is my javascript</p>
  
  <pre><code>$(document).ready(function() {
      $('.donate').on('submit', function(e) {
          $('.load').fadeIn(500);
          var formData = new FormData(this);
          console.log(formData);
          $.ajax({
              url         : "http://mydomainname.com/directory/user/makedonation",
              type        : "POST",
              data        : formData,
              contentType : false,
              cache       : false,
              processData : false,
              success     : function(data) {
                  $('.load').fadeOut(500);
                  console.log(data.status);
                  $('.donation_form').html(data);
              }
          });
      });
  });
  </code></pre>
  
  <p>This is my controller User.php where the data is being processed </p>
  
  <pre><code>public function makedonation() {
      $comments  = $this-&gt;input-&gt;post('comments');
      $user_data = $this-&gt;get_data-&gt;user_info($this-&gt;session-&gt;userdata('uid'));
      $class     = $this-&gt;db-&gt;get_where('classes', array('id' =&gt; $user_data-&gt;row()-&gt;membership));
      $amount    = $class-&gt;row()-&gt;ammount_pay;
      $data      = array(
          'user_id'    =&gt; $user_data-&gt;row()-&gt;uid,
          'amount'     =&gt; $class-&gt;row()-&gt;ammount_pay,
          'rcv_amount' =&gt; $class-&gt;row()-&gt;ammount_receive,
          'class_id'   =&gt; $class-&gt;row()-&gt;id,
          'comments'   =&gt; $comments
      ); 
  
      $rt_data = $this-&gt;data_insert-&gt;donate_user($data);
          $rcv_data = $this-&gt;get_data-&gt;user_info($rt_data['receiver_id']);
          $name     = $rcv_data-&gt;row()-&gt;first_name . " " . $rcv_data-&gt;row()-&gt;last_name;
          $view_data = array(
              'user_id'        =&gt; $user_data-&gt;row()-&gt;uid,
              'receiver_id'    =&gt; $rt_data['receiver_id'],
              'transaction_id' =&gt; $rt_data['transaction_id'],
              'comments'       =&gt; $comments,
              'name'           =&gt; $name,
              'amount'         =&gt; $class-&gt;row()-&gt;ammount_pay,
              'command'        =&gt; 'Confirm Donation'
          );
  
          $this-&gt;load-&gt;view('user/includes/get_data', $view_data);
  }
  </code></pre>
  
  <p>This is the modal where the data is being inserted into the database</p>
  
  <pre><code>public function donate_user($data) {
              $donation_data   = array(
                  'user_id'         =&gt; $data['user_id'],
                  'amount'          =&gt; $data['amount'],
                  'receive_ammount' =&gt; $data['rcv_amount'],
                  'date_deposit'    =&gt; date('m-d-Y'),
                  'time_deposit'    =&gt; date('h:i A'),
                  'class'           =&gt; $data['class_id'],
                  'status'          =&gt; 'Submitted'
              );
              $insert_donation = $this-&gt;db-&gt;insert('donation', $donation_data);
              $transaction_id  = $this-&gt;db-&gt;insert_id();
  
              $rt_data = array(
                      'message'        =&gt; 'Success',
                      'transaction_id' =&gt; $transaction_id,
                      'receiver_id'    =&gt; $receiver-&gt;row()-&gt;user_id
                  );
  
              return $rt_data;
          }
  </code></pre>
  
  <p>Now here is my confusion if the data is inserting correctly into the data base and also when I run this file separately in the browser I am referring to my controller the second page is loading up properly no errors found the why ajax is not returning data</p>