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

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

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

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

        Jquery AJAX:請(qǐng)求的資源上不存在“Access-Control-Allo

        Jquery AJAX: No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(Jquery AJAX:請(qǐng)求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭)
          <bdo id='LwMtD'></bdo><ul id='LwMtD'></ul>

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

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

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

                  本文介紹了Jquery AJAX:請(qǐng)求的資源上不存在“Access-Control-Allow-Origin"標(biāo)頭的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試從我的 localhost:4502 端口將數(shù)據(jù)發(fā)布到 API.當(dāng)我嘗試使用 POSTMAN 將數(shù)據(jù)發(fā)布到此 API 時(shí),通過提供基本授權(quán)密鑰將數(shù)據(jù)添加到后端.我試圖在 Ajax Jquery 調(diào)用中實(shí)現(xiàn)相同的功能,但出現(xiàn) CORS 錯(cuò)誤.我第一次在 jquery 中嘗試發(fā)布數(shù)據(jù),請(qǐng)?jiān)谶@里提供幫助,我可以添加什么.我已經(jīng)獲得了基本授權(quán)的 API 密鑰,因?yàn)橛脩裘兔艽a可以留空.

                  I am trying to post data to an API from my localhost:4502 port. When i tried to post data to this API using POSTMAN the data got added in the backend by providing the Basic Authorization key. The same i am trying to implement here in the Ajax Jquery call, but getting an CORS error. First time in jquery i am trying to post the data, please help here, what i can add. I have got the API key to for the Basic Authorization as a Username and Password can be left blank.

                    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
                  
                    <script>
                                 $(document).ready(function(){
                                 $("#Save").click(function(){
                  
                                    var person = new Object();
                                    person.Name = $('#Name').val();
                                    person.EmailAddress = $('#EmailAddress').val();
                                    person.CustomFields = [0];
                                    person.CustomFields[0].Key = "[Country]";
                                    person.CustomFields[0].Value = $('#Country').val();;
                  
                                 $.ajax({
                                   url: 'https://api.createsend.com/api/v3.1/subscribers/7c7a6087b0e450ad72b38be83098e271.json',
                                   type: 'POST',
                                   dataType: 'json',
                                   data:person,
                                   success: function(data,textStatus,xhr){
                  
                                       console.log(data);
                                   },
                                   error: function(xhr,textStatus,errorThrown){
                                       console.log('Error Something');
                                   },
                                   beforeSend: function(xhr) {
                  
                                      xhr.setRequestHeader("Authorization", "Basic OTdlMjVmNWJiMTdjNzI2MzVjOGU3NjlhOTI3ZTA3M2Q5MWZmMTA3ZDM2YTZkOWE5Og=="); 
                                   }
                               });
                           });
                       });
                    </script>
                  

                  推薦答案

                  我已經(jīng)添加了 dataType: 'jsonp' 并且它有效!

                  I have added dataType: 'jsonp' and it works!

                  $.ajax({
                     type: 'POST',
                     crossDomain: true,
                     dataType: 'jsonp',
                     url: '',
                     success: function(jsondata){
                  
                     }
                  })
                  

                  JSONP 是一種發(fā)送 JSON 數(shù)據(jù)的方法,無需擔(dān)心跨域問題.閱讀更多

                  JSONP is a method for sending JSON data without worrying about cross-domain issues. Read More

                  這篇關(guān)于Jquery AJAX:請(qǐng)求的資源上不存在“Access-Control-Allow-Origin"標(biāo)頭的文章就介紹到這了,希望我們推薦的答案對(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)用完成)
                  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)容)
                  XmlHttpRequest onprogress interval(XmlHttpRequest onprogress 間隔)
                  <legend id='qMR6X'><style id='qMR6X'><dir id='qMR6X'><q id='qMR6X'></q></dir></style></legend>
                1. <tfoot id='qMR6X'></tfoot>

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

                          <bdo id='qMR6X'></bdo><ul id='qMR6X'></ul>
                          • <small id='qMR6X'></small><noframes id='qMR6X'>

                              <tbody id='qMR6X'></tbody>
                            主站蜘蛛池模板: 亚洲成人一级片 | 中文一区 | 99久久国产综合精品麻豆 | 亚洲国产欧美国产综合一区 | 黄色免费观看 | 午夜电影福利 | 美女视频黄色片 | 四虎影音| 国产美女精品视频 | 亚洲成人免费视频在线 | 日韩中文字幕 | 日本免费网 | 欧美一级做性受免费大片免费 | 国产精品爱久久久久久久 | 18av在线播放 | 成人美女免费网站视频 | 中文字幕成人在线 | 国产激情一区二区三区 | 天天想天天干 | 精品日韩一区二区三区av动图 | 久久99精品久久久久 | 在线看av的网址 | 18gay男同69亚洲网站 | 国产日韩在线观看一区 | 美女国产 | 91中文字幕在线 | 日韩精品 电影一区 亚洲 | 日韩精品免费播放 | www.四虎.com| 亚洲欧美在线观看视频 | 欧美高清成人 | 性做久久久久久免费观看欧美 | 国产精品久久国产精品 | 热久久性 | 久久9久 | 国产成人精品网站 | 欧美午夜视频 | 在线观看亚洲专区 | a级大片| 国产乱码精品一区二区三区中文 | 日日摸夜夜添夜夜添精品视频 |