javascript-没有DOM元素的jQuery绑定AJAX事件

documentation of jQuery AJAX Events中,所有示例都使用jQuery DOM元素来声明这样的绑定:

$('.log').ajaxSend( hander );

我想捕获jQuery AJAX事件,而无需使用DOM元素将其附加,如下所示:

$.ajaxSend( function( event, jqXHR, ajaxOptions ){
  console.log( "ajaxSend" );
  console.log( "ajaxSend.event", event );
  console.log( "ajaxSend.jqXHR", jqXHR );
  console.log( "ajaxSend.ajaxOptions", ajaxOptions );
});

但是看起来不起作用:

Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'ajaxSend' 

有什么建议吗?

解决方法:

您可以使用以下文档:

$(document).ajaxSend( hander );

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...