title: Javascript - Property of an instance class is undefined after callback from $.post
body: <p>I have the following js snippet:</p>
  
  <pre><code>&lt;script language="javascript"&gt;
            function test() {
              this.a = 10;
          };
          test.prototype.next = function () {
              alert('before: ' + this.a);
              $.ajax({
                  url: 'some-url',
                  async: true,
                  type: 'POST',
                  dataType: 'json',
                  success: this.callback
  
              });
          };
          test.prototype.callback = function () {
              alert('after: ' + this.a);
          };
  
          $(document).ready(function () {
              var test1 = new test();
              test1.next();
          });
        &lt;/script&gt;
  </code></pre>
  
  <p>It's alway produce result:
  before: 10
  after: undefine.</p>
  
  <p>Why in the callback function of $.post, properties of class are undefined. Could anyone help me? Thanks a lot.</p>