• <tfoot id='Tn1cC'></tfoot>

    <small id='Tn1cC'></small><noframes id='Tn1cC'>

      • <bdo id='Tn1cC'></bdo><ul id='Tn1cC'></ul>
      1. <i id='Tn1cC'><tr id='Tn1cC'><dt id='Tn1cC'><q id='Tn1cC'><span id='Tn1cC'><b id='Tn1cC'><form id='Tn1cC'><ins id='Tn1cC'></ins><ul id='Tn1cC'></ul><sub id='Tn1cC'></sub></form><legend id='Tn1cC'></legend><bdo id='Tn1cC'><pre id='Tn1cC'><center id='Tn1cC'></center></pre></bdo></b><th id='Tn1cC'></th></span></q></dt></tr></i><div id='Tn1cC'><tfoot id='Tn1cC'></tfoot><dl id='Tn1cC'><fieldset id='Tn1cC'></fieldset></dl></div>
        <legend id='Tn1cC'><style id='Tn1cC'><dir id='Tn1cC'><q id='Tn1cC'></q></dir></style></legend>

        覆盖 XMLHttpRequest 的发送方法

        Overriding XMLHttpRequest#39;s send method(覆盖 XMLHttpRequest 的发送方法)
        • <legend id='Fl8RH'><style id='Fl8RH'><dir id='Fl8RH'><q id='Fl8RH'></q></dir></style></legend>

          <small id='Fl8RH'></small><noframes id='Fl8RH'>

            <tbody id='Fl8RH'></tbody>

              1. <i id='Fl8RH'><tr id='Fl8RH'><dt id='Fl8RH'><q id='Fl8RH'><span id='Fl8RH'><b id='Fl8RH'><form id='Fl8RH'><ins id='Fl8RH'></ins><ul id='Fl8RH'></ul><sub id='Fl8RH'></sub></form><legend id='Fl8RH'></legend><bdo id='Fl8RH'><pre id='Fl8RH'><center id='Fl8RH'></center></pre></bdo></b><th id='Fl8RH'></th></span></q></dt></tr></i><div id='Fl8RH'><tfoot id='Fl8RH'></tfoot><dl id='Fl8RH'><fieldset id='Fl8RH'></fieldset></dl></div>
                <tfoot id='Fl8RH'></tfoot>

                  <bdo id='Fl8RH'></bdo><ul id='Fl8RH'></ul>
                  本文介绍了覆盖 XMLHttpRequest 的发送方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在尝试通过重写 XMLHttpRequest.send 函数记录(并稍后修改)XMLHttpRequest 发送到服务器的数据.

                  I'm trying to log (and later modify) the data XMLHttpRequest sends to a server by overriding XMLHttpRequest.send function.

                  我的函数将数据正确记录到控制台,但是请求没有完成,因此浏览器会无限期地等待响应.

                  My function logs the data correctly to the console, however the request doesn't finish, therefore the browser keeps waiting for the response indefinitely.

                  你知道代码有什么问题吗?

                  Any ideas what's wrong with the code?

                  XMLHttpRequest.prototype.realSend = XMLHttpRequest.prototype.send;
                  var newSend = function(vData) { console.log("data: " + vData); realSend(vData); };
                  XMLHttpRequest.prototype.send = newSend;
                  

                  推荐答案

                  XMLHttpRequest.prototype.realSend = XMLHttpRequest.prototype.send;
                  // here "this" points to the XMLHttpRequest Object.
                  var newSend = function(vData) { console.log("data: " + vData); this.realSend(vData); };
                  XMLHttpRequest.prototype.send = newSend;
                  

                  这篇关于覆盖 XMLHttpRequest 的发送方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  SCRIPT5: Access is denied in IE9 on xmlhttprequest(SCRIPT5:在 IE9 中对 xmlhttprequest 的访问被拒绝)
                  XMLHttpRequest module not defined/found(XMLHttpRequest 模块未定义/未找到)
                  Show a progress bar for downloading files using XHR2/AJAX(显示使用 XHR2/AJAX 下载文件的进度条)
                  How can I open a JSON file in JavaScript without jQuery?(如何在没有 jQuery 的情况下在 JavaScript 中打开 JSON 文件?)
                  How do I get the HTTP status code with jQuery?(如何使用 jQuery 获取 HTTP 状态码?)
                  quot;Origin null is not allowed by Access-Control-Allow-Originquot; in Chrome. Why?(“Access-Control-Allow-Origin 不允许 Origin null在铬.为什么?)
                  <legend id='8naha'><style id='8naha'><dir id='8naha'><q id='8naha'></q></dir></style></legend>
                • <small id='8naha'></small><noframes id='8naha'>

                  <tfoot id='8naha'></tfoot>
                    <tbody id='8naha'></tbody>

                        1. <i id='8naha'><tr id='8naha'><dt id='8naha'><q id='8naha'><span id='8naha'><b id='8naha'><form id='8naha'><ins id='8naha'></ins><ul id='8naha'></ul><sub id='8naha'></sub></form><legend id='8naha'></legend><bdo id='8naha'><pre id='8naha'><center id='8naha'></center></pre></bdo></b><th id='8naha'></th></span></q></dt></tr></i><div id='8naha'><tfoot id='8naha'></tfoot><dl id='8naha'><fieldset id='8naha'></fieldset></dl></div>

                            <bdo id='8naha'></bdo><ul id='8naha'></ul>