Global ajaxError event before local error event
<p>I have a global ajaxError event, something like this:</p>

<pre><code>$(document).ajaxError(function myErrorHandler(event, xhr, ajaxOptions, thrownError) {
    alert("There was a global ajax error!");
});
</code></pre>

<p>And I have many local ajaxEvents, something like this:</p>

<pre><code>$(imageUploadForm).ajaxForm({
            url: assetsUplUrl,
            type: 'POST',
            dataType: 'json',
            data: {project_id: projectId, type: 'image', widget: widget},
            error: function(responseText, status, xhr, form){
                 alert("There was a local ajax error!");
            }
        });     
</code></pre>

<p>How can i get the global error event to trigger before the local one without changing in the local ajax?</p>