• 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;

  • 相关阅读:
    Java实现热替换
    SQL判断字符串里不包含字母
    Useful bat command
    Entity FrameworkCore教程(一):包概念理解
    Docker:Docker常见命令
    ASP.NET Core:ASP.NET Core程序使用Docker部署
    ASP.NET Core:中间件
    ASP.NET Core:依赖注入
    Jenkins:创建定时构建任务
    ASP.NET Core 3.1使用Swagger
  • 原文地址:https://www.cnblogs.com/netact/p/2212283.html
Copyright © 2020-2023  润新知