Js hook Ajax

(function() {
    var origOpen = XMLHttpRequest.prototype.open;
    
    XMLHttpRequest.prototype.open = function() {
        // console.log('request started!');
        this.addEventListener('load', function() {
            console.log(this.responseText); // 得到Ajax的返回内容
        });
        origOpen.apply(this, arguments);
    };
})();

 

posted @ 2023-05-17 16:01  黑山老道  阅读(68)  评论(0编辑  收藏  举报