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;

  • 相关阅读:
    django之上传
    djano的ORM操作
    Python中的分页管理
    MySQL作业
    socket操作
    python的os模块
    django-debug-toolbar的配置及使用
    logging模板及配置说明
    使用StrictRedis连接操作有序集合
    学习总结
  • 原文地址:https://www.cnblogs.com/netact/p/2212283.html
Copyright © 2011-2022 走看看