In the documentation of jQuery AJAX Events all the examples use a jQuery DOM Element for declare a binding like this:
$('.log').ajaxSend( hander );
I want to catch jQuery AJAX Events without the need of having a DOM Element to attach them, like this:
$.ajaxSend( function( event, jqXHR, ajaxOptions ){
console.log( "ajaxSend" );
console.log( "ajaxSend.event", event );
console.log( "ajaxSend.jqXHR", jqXHR );
console.log( "ajaxSend.ajaxOptions", ajaxOptions );
});
But It looks like it doesn't work:
Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'ajaxSend'
Any suggestion?