如下:
var origOpen = XMLHttpRequest.prototype.open; XMLHttpRequest.prototype.open = function() { this.addEventListener(‘load‘, function() { // console.log(this.readyState); //will always be 4 (ajax is completed successfully) // console.log(this.responseText); //whatever the response was console.log(1) }) origOpen.apply(this, arguments) }
原文:https://www.cnblogs.com/kiancyc/p/13863007.html