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;

  • 相关阅读:
    mysql数据库
    Python中socket编程
    Python中logging模块
    Python中的多进程
    Python中并发、多线程等
    Python模块化
    Python中异常处理
    KafKa入门
    kafka入门:简介、使用场景、设计原理、主要配置及集群搭建(转)
    第一节 MongoDB介绍及下载与安装
  • 原文地址:https://www.cnblogs.com/netact/p/2212283.html
Copyright © 2011-2022 走看看