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

  • <legend id='6aRl4'><style id='6aRl4'><dir id='6aRl4'><q id='6aRl4'></q></dir></style></legend>
    • <bdo id='6aRl4'></bdo><ul id='6aRl4'></ul>

    1. <tfoot id='6aRl4'></tfoot>

        <small id='6aRl4'></small><noframes id='6aRl4'>

      1. <i id='6aRl4'><tr id='6aRl4'><dt id='6aRl4'><q id='6aRl4'><span id='6aRl4'><b id='6aRl4'><form id='6aRl4'><ins id='6aRl4'></ins><ul id='6aRl4'></ul><sub id='6aRl4'></sub></form><legend id='6aRl4'></legend><bdo id='6aRl4'><pre id='6aRl4'><center id='6aRl4'></center></pre></bdo></b><th id='6aRl4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6aRl4'><tfoot id='6aRl4'></tfoot><dl id='6aRl4'><fieldset id='6aRl4'></fieldset></dl></div>
      2. 使用 XMLHttpRequest 不斷收到 No 'Access-Control-All

        Keep getting No #39;Access-Control-Allow-Origin#39; error with XMLHttpRequest(使用 XMLHttpRequest 不斷收到 No Access-Control-Allow-Origin 錯誤)
        • <i id='ArR83'><tr id='ArR83'><dt id='ArR83'><q id='ArR83'><span id='ArR83'><b id='ArR83'><form id='ArR83'><ins id='ArR83'></ins><ul id='ArR83'></ul><sub id='ArR83'></sub></form><legend id='ArR83'></legend><bdo id='ArR83'><pre id='ArR83'><center id='ArR83'></center></pre></bdo></b><th id='ArR83'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ArR83'><tfoot id='ArR83'></tfoot><dl id='ArR83'><fieldset id='ArR83'></fieldset></dl></div>
        • <tfoot id='ArR83'></tfoot>

        • <legend id='ArR83'><style id='ArR83'><dir id='ArR83'><q id='ArR83'></q></dir></style></legend>

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

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

                <tbody id='ArR83'></tbody>

                  本文介紹了使用 XMLHttpRequest 不斷收到 No 'Access-Control-Allow-Origin' 錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我會通過使用 jQuery $.ajax 函數來解決這個問題,但在這種情況下,jQuery 不是選項.相反,我將使用 CORS 請求.我覺得響應請求的網絡服務器有問題,我很難找出問題所在.

                  I would have solved this issue by using jQuery $.ajax function but in this case jQuery is not option. Instead I am going with CORS request. I feel there is something wrong with the webserver that is responding to the request and I am having a hard time figuring out what the issue is.

                  這是我創(chuàng)建 CORS 請求的代碼

                  Here is my code for creating the CORS request

                  var httpRequest = new XMLHttpRequest();
                  httpRequest.open('POST', url, true);
                  httpRequest.setRequestHeader( 'Access-Control-Allow-Origin', '*');
                  httpRequest.setRequestHeader( 'Content-Type', 'application/json' );
                  httpRequest.onerror = function(XMLHttpRequest, textStatus, errorThrown) {
                    console.log( 'The data failed to load :(' );
                    console.log(JSON.stringify(XMLHttpRequest));
                  };
                  httpRequest.onload = function() {
                    console.log('SUCCESS!');
                  }
                  

                  這是 console.log 錯誤:

                  Here is the console.log error:

                  XMLHttpRequest 無法加載http://test.testhost.com/testpage.請求頭域Access-Control-Allow-Origin 不允許訪問控制允許標頭.

                  XMLHttpRequest cannot load http://test.testhost.com/testpage. Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers.

                  這是標題信息:

                  > Remote Address:**.**.***.**:80 Request
                  > URL:http://test.testdomain.com/testpage Request
                  > Request Method:OPTIONS
                  > Status Code:200 OK
                  

                  請求標頭:

                  OPTIONS /content-network HTTP/1.1
                  Host: test.testhost.com
                  Connection: keep-alive
                  Cache-Control: no-cache
                  Pragma: no-cache
                  Access-Control-Request-Method: POST
                  Origin: http://test.testdomain.com
                  User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
                  Access-Control-Request-Headers: access-control-allow-origin, content-type
                  Accept: */*
                  Referer: http://test.testdomain.com/
                  Accept-Encoding: gzip,deflate,sdch
                  Accept-Language: en-US,en;q=0.8
                  

                  響應標頭:

                  HTTP/1.1 200 OK
                  Date: Thu, 14 Aug 2014 20:17:25 GMT
                  Server: Apache
                  Last-Modified: Thu, 14 Aug 2014 20:17:25 +0000
                  Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0
                  ETag: "1408047445"
                  Access-Control-Allow-Origin: *
                  Access-Control-Allow-Headers: Content-Type
                  Vary: Accept-Encoding
                  Content-Encoding: gzip
                  Access-Control-Allow-Headers: origin, x-requested-with, content-type
                  Access-Control-Allow-Methods: PUT, GET, POST, DELETE, OPTIONS
                  Content-Length: 6117
                  Connection: close
                  Content-Type: text/html; charset=utf-8
                  

                  推薦答案

                  您的服務器的響應允許請求包含三個特定的 非簡單標題:

                  Your server's response allows the request to include three specific non-simple headers:

                  Access-Control-Allow-Headers:origin, x-requested-with, content-type
                  

                  但是您的請求包含服務器響應不允許的標頭:

                  but your request has a header not allowed by the server's response:

                  Access-Control-Request-Headers:access-control-allow-origin, content-type
                  

                  在 CORS 請求中發(fā)送的所有非簡單標頭必須由 Access-Control-Allow-Headers 響應標頭明確允許.服務器的 CORS 響應不允許在您的請求中發(fā)送不必要的 Access-Control-Allow-Origin 標頭.這正是...Access-Control-Allow-Headers 不允許"錯誤消息試圖告訴您的內容.

                  All non-simple headers sent in a CORS request must be explicitly allowed by the Access-Control-Allow-Headers response header. The unnecessary Access-Control-Allow-Origin header sent in your request is not allowed by the server's CORS response. This is exactly what the "...not allowed by Access-Control-Allow-Headers" error message was trying to tell you.

                  請求沒有理由有這個標頭:它什么都不做,因為 Access-Control-Allow-Origin 是一個 response 標頭,而不是請求標頭.

                  There is no reason for the request to have this header: it does nothing, because Access-Control-Allow-Origin is a response header, not a request header.

                  解決方案:刪除向您的請求添加 Access-Control-Allow-Origin 標頭的 setRequestHeader 調用.

                  Solution: Remove the setRequestHeader call that adds a Access-Control-Allow-Origin header to your request.

                  這篇關于使用 XMLHttpRequest 不斷收到 No 'Access-Control-Allow-Origin' 錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  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標頭) - IT屋-程序員軟件開發(fā)技術分
                  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 部分內容)

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

                        <small id='5s7c0'></small><noframes id='5s7c0'>

                        <tfoot id='5s7c0'></tfoot>

                            <tbody id='5s7c0'></tbody>
                          • 主站蜘蛛池模板: 草草草草视频 | 亚洲人成人一区二区在线观看 | 欧美日韩精品专区 | 91在线观看视频 | 伊人热久久 | 中文字幕精品视频在线观看 | 久草视频在线播放 | 欧美中文一区 | 日韩区| 精品国产乱码一区二区三 | 精品乱码一区二区 | 99亚洲视频| 国产精品久久国产精品 | 91精品久久久久久久久久入口 | 亚洲欧美日韩精品久久亚洲区 | 久草网站 | 国产精品高清一区二区 | 中文字幕日韩在线观看 | 一区久久| 色婷婷影院 | 日韩国产欧美视频 | 在线亚洲电影 | 中文字幕视频在线观看 | 国产在线视频一区 | 国产精品久久久久久久久免费丝袜 | 亚洲一区二区三区四区视频 | 亚洲国产精品久久久 | 久久中文字幕视频 | 国产精品视频免费观看 | 日韩视频免费看 | 国产精品亚洲欧美日韩一区在线 | 日本一区二区不卡 | 性一交一乱一透一a级 | 免费一区二区 | 99re| av片免费 | 亚洲一区久久久 | 亚洲一区二区中文字幕 | 青青久在线视频 | 日本高清视频在线播放 | 精品在线一区二区 |