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

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

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

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

        XMLHttpRequest 無法加載,請求的資源上不存在“A

        XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
      1. <small id='VIZXp'></small><noframes id='VIZXp'>

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

              1. <tfoot id='VIZXp'></tfoot>
                  <tbody id='VIZXp'></tbody>
                  本文介紹了XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin"標頭的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  XMLHttpRequest 無法加載 http://maps.googleapis.com/maps/api/distancematrix/xml?origins=Affenhausen&destinations=Achenkirch&mode=driving&language=de-DE&sensor=false.請求的資源上不存在Access-Control-Allow-Origin"標頭.因此,Origin 'null' 不允許訪問.

                  XMLHttpRequest cannot load http://maps.googleapis.com/maps/api/distancematrix/xml?origins=Affenhausen&destinations=Achenkirch&mode=driving&language=de-DE&sensor=false. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

                  Javascript 代碼如下

                  The Javascript code is as

                  function distanceCalc(){
                      start_location = $('select.start option:selected').val();
                      target_location = $('select.end option:selected').val();
                      $.get('http://maps.googleapis.com/maps/api/distancematrix/xml?origins='+start_location+'&destinations='+target_location+'&mode=driving&language=de-DE&sensor=false', function(data) {
                  

                  DreamWeaver 可以工作,但是當我通過瀏覽器打開它時,我得到了同樣的錯誤.

                  DreamWeaver works, but when I open it via a browser, I get the same error.

                  推薦答案

                  這有點棘手,即使你正確設置了 CORS,它仍然會失敗.您應該使用 Google 的內置函數來訪問它.如果您嘗試通過 $.get() 或類似方法直接訪問它,它將失敗...查看此示例:https://developers.google.com/maps/documentation/javascript/examples/distance-matrix

                  This is a bit tricky, even if you have CORS set up properly it still fails. You should use Google's build in functions to access it. If you try to access it directly via $.get() or similar it will fail... check this example out: https://developers.google.com/maps/documentation/javascript/examples/distance-matrix

                  有趣的事實,當通過 $.get() 訪問時(我不知道為什么):

                  Interesting fact, when accessing via $.get() (I am not sure why though):

                  -THIS WORKS: http://maps.googleapis.com/maps/api/geocode/
                  
                  -THIS FAILS: http://maps.googleapis.com/maps/api/distancematrix/
                  

                  我的建議 - 不要嘗試通過 get() 獲取 json/xml.使用 google 的 API 內置函數發送請求,然后正確解析響應

                  My advice - don't try fetching json/xml via get(). Use google's API build in functions to send request and then parse the response properly

                  此示例代碼應該可以幫助您入門:

                  This example code should get you started:

                  // var origins      = [];
                  // var destinations = [];
                  
                  var distanceMatrix  = new google.maps.DistanceMatrixService();
                  var distanceRequest = { origins: origins, destinations: destinations, travelMode: google.maps.TravelMode.DRIVING, unitSystem: google.maps.UnitSystem.METRIC, avoidHighways: false, avoidTolls: false };
                  distanceMatrix.getDistanceMatrix(distanceRequest, function(response, status) {
                      if (status != google.maps.DistanceMatrixStatus.OK) {
                          alert('Error was: ' + status);
                      }
                      else {
                          var origins      = response.originAddresses;
                          var destinations = response.destinationAddresses;
                          // rest of your code here...
                      }
                  }
                  

                  這篇關于XMLHttpRequest 無法加載,請求的資源上不存在“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?)
                  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 部分內容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                      <tbody id='mnUQO'></tbody>
                  • <small id='mnUQO'></small><noframes id='mnUQO'>

                      <bdo id='mnUQO'></bdo><ul id='mnUQO'></ul>
                      <tfoot id='mnUQO'></tfoot>

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

                          <legend id='mnUQO'><style id='mnUQO'><dir id='mnUQO'><q id='mnUQO'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 国产中文字幕在线 | 国产精品免费av | 亚洲视频免费在线观看 | 日韩三区 | 老妇激情毛片免费 | 狠狠插天天干 | 国产精品国产亚洲精品看不卡15 | 亚洲欧美日韩久久 | 九九伦理电影 | 在线小视频 | 国产精品国产 | 欧美午夜精品久久久久免费视 | 国产高清自拍视频在线观看 | 亚洲一区电影 | 自拍偷拍一区二区三区 | 97视频人人澡人人爽 | 精品国产区 | 韩国主播午夜大尺度福利 | 日本一区二区不卡 | 成人在线中文字幕 | 亚洲高清在线观看 | 久久国产欧美日韩精品 | a看片| 久久成人一区 | 九九视频网 | 久久成人综合 | 国产成人免费网站 | 日韩一区中文字幕 | 免费一级淫片aaa片毛片a级 | 国产精品18久久久久久白浆动漫 | 成年网站在线观看 | 国产97久久 | 精品国产免费人成在线观看 | 国产精品99久久久久久宅男 | 国产精品久久久久久久久久免费看 | 91高清在线观看 | www.天天操.com | 玖玖视频| 99免费在线 | 国产精品国产三级国产aⅴ原创 | 国产一区亚洲二区三区 |