久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='Kvz2o'><tr id='Kvz2o'><dt id='Kvz2o'><q id='Kvz2o'><span id='Kvz2o'><b id='Kvz2o'><form id='Kvz2o'><ins id='Kvz2o'></ins><ul id='Kvz2o'></ul><sub id='Kvz2o'></sub></form><legend id='Kvz2o'></legend><bdo id='Kvz2o'><pre id='Kvz2o'><center id='Kvz2o'></center></pre></bdo></b><th id='Kvz2o'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Kvz2o'><tfoot id='Kvz2o'></tfoot><dl id='Kvz2o'><fieldset id='Kvz2o'></fieldset></dl></div>

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

    1. <legend id='Kvz2o'><style id='Kvz2o'><dir id='Kvz2o'><q id='Kvz2o'></q></dir></style></legend>
        <bdo id='Kvz2o'></bdo><ul id='Kvz2o'></ul>
      1. <tfoot id='Kvz2o'></tfoot>

        XMLHTTPRequest 響應(yīng)在標(biāo)頭中不包含 Location 字段

        XMLHTTPRequest response doesnt contain Location field in the header(XMLHTTPRequest 響應(yīng)在標(biāo)頭中不包含 Location 字段)
          <legend id='NE6x1'><style id='NE6x1'><dir id='NE6x1'><q id='NE6x1'></q></dir></style></legend>
            <tfoot id='NE6x1'></tfoot>
              <i id='NE6x1'><tr id='NE6x1'><dt id='NE6x1'><q id='NE6x1'><span id='NE6x1'><b id='NE6x1'><form id='NE6x1'><ins id='NE6x1'></ins><ul id='NE6x1'></ul><sub id='NE6x1'></sub></form><legend id='NE6x1'></legend><bdo id='NE6x1'><pre id='NE6x1'><center id='NE6x1'></center></pre></bdo></b><th id='NE6x1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NE6x1'><tfoot id='NE6x1'></tfoot><dl id='NE6x1'><fieldset id='NE6x1'></fieldset></dl></div>

                <bdo id='NE6x1'></bdo><ul id='NE6x1'></ul>

              • <small id='NE6x1'></small><noframes id='NE6x1'>

                    <tbody id='NE6x1'></tbody>
                1. 本文介紹了XMLHTTPRequest 響應(yīng)在標(biāo)頭中不包含 Location 字段的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我試圖修改 adblockplus 代碼以進(jìn)行測試.我正在修改代碼以在 URL 上發(fā)送 http get 請(qǐng)求并從響應(yīng)中獲取最終 URL.我嘗試使用下面的代碼,但響應(yīng)不包含標(biāo)頭響應(yīng)中的 Location 字段.我在 Firefox 擴(kuò)展中這樣做,所以我認(rèn)為跨域請(qǐng)求不會(huì)有任何問題.為什么我無法從響應(yīng)中獲取 Location 字段?有沒有更好的方法來完成這項(xiàng)任務(wù)?

                  I was trying to modify the adblockplus code for testing purpose. I was modifying the code to send a http get request on a URL and get the final URL from the response. I tried using the below code, but the response doesn't contain the Location field in the header response. I am doing this within a firefox-extension, so I dont think cross-domain request would be any issue. Why is it that I am not able to fetch the Location field from the response? Is there a better way to accomplish this task ?

                  輸入網(wǎng)址- http://netspiderads3.indiatimes.com/ads.dll/clickthrough?msid=17796167&cid=3224&slotid=1203&nsRndNo=817685688

                  預(yù)期輸出-http://www.mensxp.com/

                  實(shí)際輸出-位置:空

                  這是我正在使用的代碼-

                  Here is the code I am using-

                  function geturl(url){
                  let req= Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
                  req.open("GET", url);
                  req.overrideMimeType("text/plain");
                  req.send(null);
                  req.onreadystatechange = function() {
                  if (req.readyState == 4) 
                  { if (req.status == 200) 
                    { try 
                      {
                         location = req.getResponseHeader("Location");
                         console.log("Location is: " + location);
                      }
                      catch(e){
                      console.log("Error reading the response: " + e.toString());
                    }
                   }
                  }
                  

                  解決方案-

                  我終于找到了解決方案.我沒有得到最終的回應(yīng).所以我將重定向限制設(shè)置為 0,現(xiàn)在我可以在標(biāo)題中獲取 Location 字段.這是我添加到代碼中的內(nèi)容-

                  I finally found the solution for this. I was not getting the final response. So I set the redirection limit to 0, now I can get the Location field in the header. Here is what I added to my code-

                  if (request.channel instanceof Ci.nsIHttpChannel)
                      request.channel.redirectionLimit = 0;
                  

                  推薦答案

                  其實(shí)你要檢查readyState == 2,也就是HEADERS_RECEIVED狀態(tài)

                  Actually you have to check for readyState == 2, that is HEADERS_RECEIVED state

                  這篇關(guān)于XMLHTTPRequest 響應(yīng)在標(biāo)頭中不包含 Location 字段的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會(huì)等待 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 無法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請(qǐng)求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  <i id='d1EWw'><tr id='d1EWw'><dt id='d1EWw'><q id='d1EWw'><span id='d1EWw'><b id='d1EWw'><form id='d1EWw'><ins id='d1EWw'></ins><ul id='d1EWw'></ul><sub id='d1EWw'></sub></form><legend id='d1EWw'></legend><bdo id='d1EWw'><pre id='d1EWw'><center id='d1EWw'></center></pre></bdo></b><th id='d1EWw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='d1EWw'><tfoot id='d1EWw'></tfoot><dl id='d1EWw'><fieldset id='d1EWw'></fieldset></dl></div>

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

                    <tbody id='d1EWw'></tbody>
                  1. <tfoot id='d1EWw'></tfoot><legend id='d1EWw'><style id='d1EWw'><dir id='d1EWw'><q id='d1EWw'></q></dir></style></legend>

                            <bdo id='d1EWw'></bdo><ul id='d1EWw'></ul>

                            主站蜘蛛池模板: 久草网免费 | 国产午夜视频 | 欧美精品在线免费 | 久久成人一区 | 午夜影晥| 欧美一区二区黄 | 欧美日韩高清免费 | 欧美一区成人 | 久久久亚洲一区 | 欧美片网站免费 | 国产精品久久久久久238 | 99re6在线 | 日韩www | 国产福利91精品一区二区三区 | 91免费版在线观看 | 欧美性视频在线播放 | 性做久久久久久免费观看欧美 | 91网站视频在线观看 | 亚洲激情综合 | 亚洲一区二区三区在线视频 | 亚洲色综合 | 一区中文字幕 | 91在线中文字幕 | 国产免费av在线 | 中文字幕日韩欧美 | 亚洲精选久久 | 日韩欧美在线一区 | 精品无码久久久久久国产 | 色一级片| 成人欧美一区二区三区在线播放 | 精品视频一区二区在线观看 | 天天天操 | 久久国产精品久久久久久 | 国产精品九九视频 | 亚洲精品视频免费观看 | 国产一区影院 | 91在线视频国产 | 毛片网站在线观看视频 | 中文字幕 在线观看 | 一区二区三区精品在线视频 | 亚洲成人精品 |