| 1 | ;(function() { | 
监听示例1
2
3
4
5
6
7
8
9
10
11var xhr = new XMLHttpRequest();
window.addEventListener('ajaxReadyStateChange', function (e) {
  console.log(e.detail); // XMLHttpRequest Object
});
window.addEventListener('ajaxAbort', function (e) {
  console.log(e.detail.responseText); // XHR 返回的内容
});
xhr.open('GET', 'info.json');
xhr.send();
via: 已无法找到原始出处
p.s. 这里有更高级的拦截ajax请求方法
 
        