• <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 的发送方法

        时间:2023-05-15
        • <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 的发送方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:传递“#"url的请求参数中的哈希符号在Firefox中不起作用 下一篇:NETWORK_ERR:XMLHttpRequest 异常 101

                  相关文章

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