How to access Parent from child in JS
<p>I want to access an object's own function from a jQuery method which fails.</p>

<pre><code>function obj(){    
    this.send = function(){
        $.get("send.php",null,function(data){
            this.success();
        }).error(function(){ this.fail(); });
    }
    this.fail = function(){
        alert("fail");
    }
}

var o = new obj();
o.send();
</code></pre>

<p>Gives this error: <code>TypeError: this.fail is not a function</code></p>

<p>How to access function <code>fail</code> inside jQuery?</p>
