Skip to content

Latest commit

 

History

History
17 lines (16 loc) · 727 Bytes

README.md

File metadata and controls

17 lines (16 loc) · 727 Bytes

xhr

监控xhr状态变化

应用

<script src="xhr.event.js"></script>
<script>
  window.addEventListener('ajaxReadyStateChange', function(e) {console.log(e.detail)}
  window.addEventListener('ajaxAbort', function(e) {console.log(e.detail)}
  window.addEventListener('ajaxError', function(e) {console.log(e.detail)}
  window.addEventListener('ajaxLoad', function(e) {console.log(e.detail)}
  window.addEventListener('ajaxLoadStart', function(e) {console.log(e.detail)}
  window.addEventListener('ajaxProgress', function(e) {console.log(e.detail)}
  window.addEventListener('ajaxTimeout', function(e) {console.log(e.detail)}
  window.addEventListener('ajaxLoadEnd', function(e) {console.log(e.detail)}
</script>