jQuery ajax callback memeber of class?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/5378622/is-there-a-way-for-a-jquery-ajax-success-function-to-access-the-object-its-cont">Is there a way for a JQuery ajax success function to access the object it’s contained in?</a>  </p>
</blockquote>



<p>I have some code like that</p>

<pre><code>myClass.prototype.doStuff = function(){

  $.ajax({
        type: 'POST',
        url: $('#form').attr('action'),
        data: $('#form').serialize(),
        success: this.callback
  });
};

myClass.prototype.callback = function(data){
   if(this.someFlag){
     //do some stuff  
   }

};
</code></pre>

<p>In this case I supposed <code>this</code> to be the instance of myClass, but it isn't actually. Why is that?</p>
