How to move an anonymous function out
<p>I have a $.ajax call with an error callback:</p>

<pre><code>error: function(result){
$('#msg').text(result.statusText).addClass('err');
}
</code></pre>

<p>I'd like to change it to a more generic:</p>

<pre><code>error: myError(result)
</code></pre>

<p>And then all by itself:</p>

<pre><code>function myError(theError){
$('#msg').text(theError.statusText).addClass('err');
} 
</code></pre>

<p>But firebug is telling me "result" is not defined.</p>

<p>Q: Do I call it this way?</p>

<pre><code>error: function(result){
myError(result);
}
</code></pre>
