title: Javascript (prototype) method call from ajax callback
body: <p>I have written some object oriented Javascript like this:</p>
  
  <pre><code>function MyClass(){
  
      this.SomeFunc(arg1){
          result = &lt;some processing on arg1&gt;;
          return result;
      };
  
      this.SomeOtherFunc(){
          return $.ajax({
              &lt;some restful call&gt;
          }).done(function(){
              var localvar = this.SomeFunc(&lt;value obtained by restful call&gt;);
              &lt;some operations with localvar&gt;;
          });
      };
  };
  
  var myObj = new MyClass();
  myObj.SomeOtherFunc();
  </code></pre>
  
  <p>And I get an error in the web console: "this.SomeFunc is not a function". If I call it within a function directly, there is no problem. The call fails only inside Ajax. What would be the proper way of making this function call?</p>