title: javascript function response is empty
body: <p>Here is the code to add the data in the database. But it is going is the else section.
  response is empty. i checked by alert the response. but it is empty.</p>
  
  <pre><code>    //add donation by ajaxs
  function ccjkfoundation_adddonation()
  {
      var dateobj  = jQuery('#donation_date');
      var nameobj  = jQuery('#donation_name');
      var desobj   = jQuery('#donation_des');
      var assetobj = jQuery('#donation_asset');
      var data = {
              action: 'ccjkfoundation_adddonation', 
              date:  dateobj.val(),
              name:  nameobj.val(),
              des:   desobj.val(),
              asset: assetobj.val()
          };
      jQuery.post(ajaxurl, data, function(response){
      alert(response);
          if(response)
          {
              var retstr = eval("("+response+")");
              jQuery('#donation-con').prepend(retstr['list']);
              jQuery('#other_donation_asset').text('￥'+retstr['ototalasset']).attr('title',retstr['ototalasset']);
              dateobj.val('');
              nameobj.val('');
              desobj.val('');
              assetobj.val('');
              ccjkfoundation_total_asset();
          }
          else
          {
  
              alert('Failure');
          }
      });
  }
  </code></pre>
  
  <p>here is the php function. please check this, if i need to change in database tables may be.</p>
  
  <pre><code>    function ccjkfoundation_adddonation_callback()
  {
      ob_clean();
      $date  = trim($_POST['date']);
      $name  = trim($_POST['name']);
      $des   = trim($_POST['des']);
      $asset = trim($_POST['asset']);
      $ototalasset = get_option('ccjk_other_donation');
      if(empty($name) || empty($asset) || !is_numeric($asset))
          exit('');
      global $wpdb;
      $result = $wpdb-&gt;insert( DONATION_TABLE, array(
              'name' =&gt; stripslashes($name),
              'des' =&gt; stripslashes($des),
              'asset' =&gt; $asset,
              'date' =&gt; stripslashes($date)
              ));
      if(!$result)
          exit('');
      $donation_id = (int) $wpdb-&gt;insert_id;
      $ototalasset+=$asset;
      $return_json = array('ototalasset'=&gt;number_format($ototalasset));
      update_option('ccjk_other_donation', $ototalasset);
      $liststr = '
          &lt;tr id="donation_'.$donation_id.'"&gt;
              &lt;td&gt;&lt;input type="text" name="donation_date_'.$donation_id.'" id="donation_date_'.$donation_id.'"  class="form-required form-input-tip" placeholder="Date of Donation" aria-required="true" value="'.$date.'"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="donation_name_'.$donation_id.'" id="donation_name_'.$donation_id.'"  class="form-required form-input-tip" placeholder="Donor Name" aria-required="true" value="'.$name.'"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="donation_des_'.$donation_id.'" id="donation_des_'.$donation_id.'"   class="form-input-tip" placeholder="Donor Description" value="'.$des.'"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="text" name="donation_asset_'.$donation_id.'" id="donation_asset_'.$donation_id.'" class="form-required form-input-tip" placeholder="0" aria-required="true" value="'.$asset.'"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="button" class="button" value="Update" onclick="ccjkfoundation_updatedonation('.$donation_id.')"&gt; &lt;input type="button" class="button" value="Del" onclick="ccjkfoundation_deldonation('.$donation_id.');"&gt;&lt;/td&gt;
          &lt;/tr&gt;                       
          ';  
      $return_json['list'] = $liststr;
      echo json_encode($return_json);
      die(); // this is required to return a proper result 这里是必须的
  }
  </code></pre>