赞
踩
function listen() { var origin = { open: XMLHttpRequest.prototype.open, send: XMLHttpRequest.prototype.send } XMLHttpRequest.prototype.open = function(a, b) { // console.log('open'); // this.addEventListener('loadend', onReadyStateChangeReplacement); this.addEventListener('load', replaceFn) // this.addEventListener('readystatechange', replaceFn); origin.open.apply(this, arguments) } XMLHttpRequest.prototype.send = function(a, b) { origin.send.apply(this, arguments) } function replaceFn(obj) { // console.log(obj);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。