title: How to pass parameters with jquery proxy() to a function which has already other parameters
body: <p>As asked, i have updated the code to my specific issue:</p>
  
  <pre><code>function A(){
      this.data1 = null;
      this.data2 = null;
  }
  A.prototype.receiveData1AndData2FromServer = function(callback){
      this.doneCallback = $.proxy( function foo(importantData, callback){
          this.data1 = importantData.data1;
          this.data2 = importantData.data2;
          callback != undefined ? callback() : null;
      }, this, callback);
  
      checkFail = $.proxy(
          function (jqXHR, textStatus, errorThrown) {
              try {
                  var str = new String(jqXHR.responseText);
                  var result = JSON.parse(str.substring(str.indexOf('{')));
                  this.doneCallback(result);
              } catch (ex) { console.log(ex); }
          }
      , this);
      $.ajax({
          type: 'POST', url: 'get_data1_and_data2.php', data: { 'id': this.id }, dataType: 'json'
      }).done(this.doneCallback)
      .fail(checkFail);
      }
  </code></pre>
  
  <p>(The problem is that the callback parameter is replacing the first parameter(importantData) instead of the second.)</p>
  
  <p>There are calls with different callback parameter to A::receiveData1AndData2FromServer.
  I want to pass the callback to A::doneCallback, so when the retrieval is done, the right callback will be called.</p>