久久久久久久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 錯(cuò)誤)
        • <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' 錯(cuò)誤的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我會(huì)通過(guò)使用 jQuery $.ajax 函數(shù)來(lái)解決這個(gè)問(wèn)題,但在這種情況下,jQuery 不是選項(xiàng).相反,我將使用 CORS 請(qǐng)求.我覺(jué)得響應(yīng)請(qǐng)求的網(wǎng)絡(luò)服務(wù)器有問(wèn)題,我很難找出問(wèn)題所在.

                  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 請(qǐng)求的代碼

                  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 錯(cuò)誤:

                  Here is the console.log error:

                  XMLHttpRequest 無(wú)法加載http://test.testhost.com/testpage.請(qǐng)求頭域Access-Control-Allow-Origin 不允許訪問(wèn)控制允許標(biāo)頭.

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

                  這是標(biāo)題信息:

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

                  請(qǐng)求標(biāo)頭:

                  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
                  

                  響應(yīng)標(biāo)頭:

                  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
                  

                  推薦答案

                  您的服務(wù)器的響應(yīng)允許請(qǐng)求包含三個(gè)特定的 非簡(jiǎn)單標(biāo)題:

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

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

                  但是您的請(qǐng)求包含服務(wù)器響應(yīng)不允許的標(biāo)頭:

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

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

                  在 CORS 請(qǐng)求中發(fā)送的所有非簡(jiǎn)單標(biāo)頭必須由 Access-Control-Allow-Headers 響應(yīng)標(biāo)頭明確允許.服務(wù)器的 CORS 響應(yīng)不允許在您的請(qǐng)求中發(fā)送不必要的 Access-Control-Allow-Origin 標(biāo)頭.這正是...Access-Control-Allow-Headers 不允許"錯(cuò)誤消息試圖告訴您的內(nèi)容.

                  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.

                  請(qǐng)求沒(méi)有理由有這個(gè)標(biāo)頭:它什么都不做,因?yàn)?Access-Control-Allow-Origin 是一個(gè) response 標(biāo)頭,而不是請(qǐng)求標(biāo)頭.

                  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.

                  解決方案:刪除向您的請(qǐng)求添加 Access-Control-Allow-Origin 標(biāo)頭的 setRequestHeader 調(diào)用.

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

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

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(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 無(wú)法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開(kāi)發(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='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>
                          • 主站蜘蛛池模板: 国产清纯白嫩初高生视频在线观看 | 国产在线www | 成人亚洲视频 | 波多野结衣电影一区 | 成人av激情 | 成人免费影院 | 日韩视频一区 | 国产一区二区精品在线观看 | 欧美不卡一区二区三区 | 国产精品久久久免费 | 中文字幕日韩欧美一区二区三区 | 在线免费黄色小视频 | 激情五月综合 | 亚洲国产aⅴ成人精品无吗 综合国产在线 | 亚洲天堂影院 | 亚洲精品久久久久久久久久吃药 | 欧美三区视频 | 欧美日韩精品中文字幕 | 99草免费视频 | 国产资源视频 | 99精品热视频 | 欧美一区二区免费 | 亚洲国产一区二区视频 | 8x国产精品视频一区二区 | 精品成人一区二区 | 国产清纯白嫩初高生在线播放视频 | 久久精品二区 | 羞羞视频在线观看网站 | 天堂在线1 | 欧美一区二区三区视频 | 久久高清精品 | 国产专区在线 | 91精品一区二区三区久久久久久 | 中文字幕在线免费观看 | 丝袜 亚洲 另类 欧美 综合 | 日韩精品视频在线免费观看 | 99久久久久久99国产精品免 | 国产a级黄色录像 | 精品婷婷 | 日韩成人免费 | 亚洲视频精品 |