pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  1. <i id='WVrg5'><tr id='WVrg5'><dt id='WVrg5'><q id='WVrg5'><span id='WVrg5'><b id='WVrg5'><form id='WVrg5'><ins id='WVrg5'></ins><ul id='WVrg5'></ul><sub id='WVrg5'></sub></form><legend id='WVrg5'></legend><bdo id='WVrg5'><pre id='WVrg5'><center id='WVrg5'></center></pre></bdo></b><th id='WVrg5'></th></span></q></dt></tr></i><div class="drmdzlc" id='WVrg5'><tfoot id='WVrg5'></tfoot><dl id='WVrg5'><fieldset id='WVrg5'></fieldset></dl></div>
  2. <small id='WVrg5'></small><noframes id='WVrg5'>

    1. <legend id='WVrg5'><style id='WVrg5'><dir id='WVrg5'><q id='WVrg5'></q></dir></style></legend>

      <tfoot id='WVrg5'></tfoot>
      • <bdo id='WVrg5'></bdo><ul id='WVrg5'></ul>

      自定義 XMLHttpRequest.prototype.open

      custom XMLHttpRequest.prototype.open(自定義 XMLHttpRequest.prototype.open)
      • <tfoot id='HYVtI'></tfoot>
            <bdo id='HYVtI'></bdo><ul id='HYVtI'></ul>

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

            1. <legend id='HYVtI'><style id='HYVtI'><dir id='HYVtI'><q id='HYVtI'></q></dir></style></legend>

                <i id='HYVtI'><tr id='HYVtI'><dt id='HYVtI'><q id='HYVtI'><span id='HYVtI'><b id='HYVtI'><form id='HYVtI'><ins id='HYVtI'></ins><ul id='HYVtI'></ul><sub id='HYVtI'></sub></form><legend id='HYVtI'></legend><bdo id='HYVtI'><pre id='HYVtI'><center id='HYVtI'></center></pre></bdo></b><th id='HYVtI'></th></span></q></dt></tr></i><div class="phdjm2b" id='HYVtI'><tfoot id='HYVtI'></tfoot><dl id='HYVtI'><fieldset id='HYVtI'></fieldset></dl></div>
                  <tbody id='HYVtI'></tbody>
              1. 本文介紹了自定義 XMLHttpRequest.prototype.open的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                var open = XMLHttpRequest.prototype.open;
                
                XMLHttpRequest.prototype.open = function(method, uri, async, user, pass) {
                    this.addEventListener("readystatechange", function(event) {  
                    if(this.readyState == 4){
                       var self = this;
                       var response = {
                         method: method,
                         uri: uri,
                         responseText: self.responseText
                      };
                      console.log(response);  
                    } else {
                        console.log(this.readyState);
                    }
                    }, false);
                  open.call(this, method, uri, async, user, pass);
                };
                

                我正在嘗試在發(fā)送 XHR 之前收聽它們.$.ajax 方法中類似于 jQuery 的 beforeSend 方法.

                I am trying to listen for XHR before they are being sent. Something similar to jQuery's beforeSend in the $.ajax method.

                我的目標(biāo)是在發(fā)送所有 XHR 之前監(jiān)聽它們.我想最接近的方法是檢查上面是否 this.readyState === 1?

                My goal is to listen for all XHR's before they are being sent. I suppose the closest thing would be to check above if this.readyState === 1?

                上面的代碼是否會因為我在 XMLHttpRequest 上使用原型而導(dǎo)致任何 ajax 庫(如 jQuery)出現(xiàn)故障?

                Would the code above cause any ajax libraries like jQuery to malfunction because I use prototype on XMLHttpRequest?

                推薦答案

                我正在嘗試在發(fā)送 XHR 之前監(jiān)聽它們.

                I am trying to listen for XHR before they are being sent.

                然后嘗試欺騙 send() 方法,而不是 open() 方法.

                Then try to spoof the send() method, not the open() one.

                上面的代碼是否會因為我在 XMLHttpRequest 上使用原型而導(dǎo)致任何 ajax 庫(如 jQuery)出現(xiàn)故障?

                Would the code above cause any ajax libraries like jQuery to malfunction because I use prototype on XMLHttpRequest?

                不,不是真的.只是,

                • 在那些庫選擇不使用 XMLHttpRequest(尤其是 IE)的情況下它不起作用
                • …如果瀏覽器不支持 XMLHttpRequest 對象(或不支持訪問或修改其原型),甚至?xí)?/li>
                • libs 可能能夠通過在你可以之前取消引用函數(shù)來解決你的欺騙問題(盡管我不知道有什么常見的 lib)
                • 您的代碼使用固定數(shù)量的參數(shù)調(diào)用本機方法,不確定這是否會影響任何內(nèi)容,并且它不會重新返回結(jié)果(即使我們知道它是 undefined).為 100% 確定,請使用 return open.apply(this, arguments);.
                • it won't work where those libs choose not to use XMLHttpRequest (particularly IE)
                • …and even fail if the browser does not support the XMLHttpRequest object (or does not support accessing or modifying its prototype)
                • libs might be able to work around your spoof by dereferencing the functions before you can (though I don't know any common lib that does)
                • Your code calls the native method with a fixed number of arguments, not sure if that affects anything, and it does not re-return the result (even if we know it's undefined). To be 100% sure, use return open.apply(this, arguments);.

                這篇關(guān)于自定義 XMLHttpRequest.prototype.open的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調(diào)用完成)
                JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  <bdo id='QllOd'></bdo><ul id='QllOd'></ul>
                    <tbody id='QllOd'></tbody>

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

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

                        1. 主站蜘蛛池模板: 液氮罐_液氮容器_自增压液氮罐_杜瓦瓶_班德液氮罐厂家 | 超声骨密度仪-动脉硬化检测仪器-人体成分分析仪厂家/品牌/价格_南京科力悦 | 行星搅拌机,双行星搅拌机,动力混合机,无锡米克斯行星搅拌机生产厂家 | 仓储笼_仓储货架_南京货架_仓储货架厂家_南京货架价格低-南京一品仓储设备制造公司 | 天助网 - 中小企业全网推广平台_生态整合营销知名服务商_天助网采购优选 | 全自动包衣机-无菌分装隔离器-浙江迦南科技股份有限公司 | 江苏农村商业银行招聘网_2024江苏农商行考试指南_江苏农商行校园招聘 | 电加热导热油炉-空气加热器-导热油加热器-翅片电加热管-科安达机械 | 咖啡加盟,咖啡店加盟连锁品牌-卡小逗 | 哈希余氯测定仪,分光光度计,ph在线监测仪,浊度测定仪,试剂-上海京灿精密机械有限公司 | 深圳VI设计-画册设计-LOGO设计-包装设计-品牌策划公司-[智睿画册设计公司] | RFID电子标签厂家-上海尼太普电子有限公司| 石家庄小程序开发_小程序开发公司_APP开发_网站制作-石家庄乘航网络科技有限公司 | 论文查重_免费论文查重_知网学术不端论文查重检测系统入口_论文查重软件 | 儋州在线-儋州招聘找工作、找房子、找对象,儋州综合生活信息门户! | 聚合氯化铝_喷雾聚氯化铝_聚合氯化铝铁厂家_郑州亿升化工有限公司 | 长城人品牌官网| 网站制作优化_网站SEO推广解决方案-无锡首宸信息科技公司 | 座椅式升降机_无障碍升降平台_残疾人升降平台-南京明顺机械设备有限公司 | LZ-373测厚仪-华瑞VOC气体检测仪-个人有毒气体检测仪-厂家-深圳市深博瑞仪器仪表有限公司 | 济南菜鸟驿站广告|青岛快递车车体|社区媒体-抖音|墙体广告-山东揽胜广告传媒有限公司 | 污水处理设备,一体化泵站,一体化净水设备-「梦之洁环保设备厂家」 | 钢格板|镀锌钢格板|热镀锌钢格板|格栅板|钢格板|钢格栅板|热浸锌钢格板|平台钢格板|镀锌钢格栅板|热镀锌钢格栅板|平台钢格栅板|不锈钢钢格栅板 - 专业钢格板厂家 | 活性炭厂家-蜂窝活性炭-粉状/柱状/果壳/椰壳活性炭-大千净化-活性炭 | 高效节能电机_伺服主轴电机_铜转子电机_交流感应伺服电机_图片_型号_江苏智马科技有限公司 | 西子馋火锅鸡加盟-太原市龙城酉鼎餐饮管理有限公司 | 厦门ISO认证|厦门ISO9001认证|厦门ISO14001认证|厦门ISO45001认证-艾索咨询专注ISO认证行业 | 硬度计,金相磨抛机_厂家-莱州华煜众信试验仪器有限公司 | 变位机,焊接变位机,焊接变位器,小型变位机,小型焊接变位机-济南上弘机电设备有限公司 | 太平洋亲子网_健康育儿 品质生活 | 体检车_移动CT车_CT检查车_CT车_深圳市艾克瑞电气有限公司移动CT体检车厂家-深圳市艾克瑞电气有限公司 | 茶楼装修设计_茶馆室内设计效果图_云臻轩茶楼装饰公司 | 无尘烘箱_洁净烤箱_真空无氧烤箱_半导体烤箱_电子防潮柜-深圳市怡和兴机电 | 精密交叉滚子轴承厂家,转盘轴承,YRT转台轴承-洛阳千协轴承 | 哔咔漫画网页版在线_下载入口访问指引 | 油液红外光谱仪-油液监测系统-燃油嗅探仪-上海冉超光电科技有限公司 | 磁力抛光研磨机_超声波清洗机厂家_去毛刺设备-中锐达数控 | IPO咨询公司-IPO上市服务-细分市场研究-龙马咨询 | 北京网站建设公司_北京网站制作公司_北京网站设计公司-北京爱品特网站建站公司 | 油液红外光谱仪-油液监测系统-燃油嗅探仪-上海冉超光电科技有限公司 | 华溶溶出仪-Memmert稳定箱-上海协烁仪器科技有限公司 |