jquery Ajax $.ajaxError
<p>I have a bunch of ajax calls that contain success and error conditions like this one:</p>

<pre><code>    $.ajax({
        url: 'Remote/State.cfc'
        ,type: "POST"
        ,data: {
            'method': 'UpdateStateName'
            ,'StateID': StateID
            ,'StateName': StateName
        }
        ,success: function(result){
            if (isNaN(result)) {
                $('#msg').text(result).addClass('err');
            } else {
                $('#' + result + ' input[name="StateName"]').addClass('changed');
            };
        }
        ,error: function(msg){
            $('#msg').text('Connection error').addClass('err');
        }
    });
</code></pre>

<p>All the error conditions are the same.  In other words, they all put the phrase "Connection error" in the msg id.</p>

<p>Q1: Could I remove all these and replace them with</p>

<pre><code>$().ajaxError(function(myEvent, request, settings, thrownError) {
    $('#msg').text('Connection error').addClass('err');
});
</code></pre>

<p>Q2: How would you use myEvent and request to display a more informative error message?</p>
