zoukankan      html  css  js  c++  java
  • XMLHttpRequest 事件更改

    var open = window.XMLHttpRequest.prototype.open,
                send = window.XMLHttpRequest.prototype.send,
                onReadyStateChange;

            function openReplacement(method, url, async, user, password) {
                var syncMode = async !== false ? 'async' : 'sync';
                alert('Preparing ' +syncMode +' HTTP request : ' + method + ' ' + url
        );
                return open.apply(this, arguments);
            }

            function sendReplacement(data) {
                alert('Sending HTTP request data : ', data);

                if (this.onreadystatechange) {
                    this._onreadystatechange = this.onreadystatechange;
                }
                this.onreadystatechange = onReadyStateChangeReplacement;

                return send.apply(this, arguments);
            }

            function onReadyStateChangeReplacement() {
                alert('HTTP request ready state changed : ' + this.readyState);
                if (this._onreadystatechange) {
                    return this._onreadystatechange.apply(this, arguments);
                }
            }

            window.XMLHttpRequest.prototype.open = openReplacement;
            window.XMLHttpRequest.prototype.send = sendReplacement;

  • 相关阅读:
    LeetCode0350.两个数组的交集 II
    LeetCode0055.跳跃游戏
    LeetCode0739.每日温度
    LeetCode面试题46.把数字翻译成字符串
    LeetCode0128.最长连续序列
    LeetCode面试题29.顺时针打印矩阵
    LeetCode0238.除自身以外数组的乘积
    2020软件工程最后一次作业
    如何防止XSS攻击
    需求规格说明书
  • 原文地址:https://www.cnblogs.com/netact/p/2212283.html
Copyright © 2011-2022 走看看