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

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

  • <legend id='g93gi'><style id='g93gi'><dir id='g93gi'><q id='g93gi'></q></dir></style></legend>
    <tfoot id='g93gi'></tfoot>

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

        AngularJS 錯誤:跨源請求僅支持協(xié)議方案:http、dat

        AngularJS Error: Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https(AngularJS 錯誤:跨源請求僅支持協(xié)議方案:http、data、chrome-extension、https) - IT屋-程序員軟件開發(fā)技術(shù)分

          <tfoot id='FiWdd'></tfoot>
          • <bdo id='FiWdd'></bdo><ul id='FiWdd'></ul>

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

                <legend id='FiWdd'><style id='FiWdd'><dir id='FiWdd'><q id='FiWdd'></q></dir></style></legend>
                • <small id='FiWdd'></small><noframes id='FiWdd'>

                • 本文介紹了AngularJS 錯誤:跨源請求僅支持協(xié)議方案:http、data、chrome-extension、https的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個非常簡單的 Angular js 應(yīng)用程序的三個文件

                  I have three files of a very simple angular js application

                  index.html

                  <!DOCTYPE html>
                  <html ng-app="gemStore">
                    <head>
                      <script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js'></script>
                      <script type="text/javascript" src="app.js"></script>
                    </head>
                  
                    <body ng-controller="StoreController as store">
                        <div class="list-group-item" ng-repeat="product in store.products">
                          <h3>{{product.name}} <em class="pull-right">{{product.price | currency}}</em></h3>
                        </div>
                  
                    <product-color></product-color>
                    </body>
                  </html>
                  

                  product-color.html

                  <div class="list-group-item">
                      <h3>Hello <em class="pull-right">Brother</em></h3>
                  </div>
                  

                  app.js

                  (function() {
                    var app = angular.module('gemStore', []);
                  
                    app.controller('StoreController', function($http){
                                this.products = gem;
                            }
                    );
                  
                    app.directive('productColor', function() {
                        return {
                            restrict: 'E', //Element Directive
                            templateUrl: 'product-color.html'
                        };
                     }
                    );
                  
                    var gem = [
                                {
                                    name: "Shirt",
                                    price: 23.11,
                                    color: "Blue"
                                },
                                {
                                    name: "Jeans",
                                    price: 5.09,
                                    color: "Red"
                                }
                    ];
                  
                  })();
                  

                  當我使用名為 productColor 的自定義指令輸入 product-color.html 的包含時,我就開始收到此錯誤:

                  I started getting this error as soon as I entered an include of product-color.html using custom directive named productColor:

                  XMLHttpRequest cannot load file:///C:/product-color.html. Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https, chrome-extension-resource.
                  angular.js:11594 Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/product-color.html'.
                  

                  可能出了什么問題?是否是 product-color.html 的路徑問題?

                  What may be going wrong? Is it a path issue for product-color.html?

                  我的三個文件都在同一個根文件夾C:/user/project/

                  All my three files are in the same root folder C:/user/project/

                  推薦答案

                  出現(xiàn)此錯誤是因為您只是直接從瀏覽器打開 html 文檔.要解決此問題,您需要從網(wǎng)絡(luò)服務(wù)器提供代碼并在 localhost 上訪問它.如果您有 Apache 設(shè)置,請使用它來提供文件.一些 IDE 內(nèi)置了 Web 服務(wù)器,例如 JetBrains IDE、Eclipse...

                  This error is happening because you are just opening html documents directly from the browser. To fix this you will need to serve your code from a webserver and access it on localhost. If you have Apache setup, use it to serve your files. Some IDE's have built in web servers, like JetBrains IDE's, Eclipse...

                  如果您有 Node.Js 設(shè)置,那么您可以使用 http-server.只需運行 npm install http-server -g 即可在終端中使用它,例如 http-server C:location oapp.

                  If you have Node.Js setup then you can use http-server. Just run npm install http-server -g and you will be able to use it in terminal like http-server C:location oapp.

                  這篇關(guān)于AngularJS 錯誤:跨源請求僅支持協(xié)議方案:http、data、chrome-extension、https的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會等待 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 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                  • <bdo id='F0biC'></bdo><ul id='F0biC'></ul>

                    <tfoot id='F0biC'></tfoot>

                      <legend id='F0biC'><style id='F0biC'><dir id='F0biC'><q id='F0biC'></q></dir></style></legend>
                        <tbody id='F0biC'></tbody>
                      • <small id='F0biC'></small><noframes id='F0biC'>

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

                          1. 主站蜘蛛池模板: 这里精品 | 在线欧美视频 | 91大神新作在线观看 | 四虎免费视频 | 日本久久久影视 | 亚洲一区二区三区在线免费观看 | 日韩一区二区三区视频 | 久久久久一区二区三区 | 欧美a区| 精品国产黄a∨片高清在线 成人区精品一区二区婷婷 日本一区二区视频 | 成人免费视频观看视频 | 美国av片在线观看 | 久久精品一 | 精品日韩一区二区三区 | 国产精品伦理一区 | 久久久久久久久久久国产 | 在线观看国产精品视频 | 色婷婷亚洲国产女人的天堂 | 中文字幕精品一区二区三区精品 | 成人亚洲网 | 国产成人精品久久 | 在线小视频 | 91黄色片免费看 | 欧美色999 | 精品亚洲一区二区 | 麻豆视频在线看 | 亚洲精品二区 | 伊人精品在线 | 五月天国产在线 | 在线观看中文视频 | 亚洲国产一区二区三区四区 | 男人天堂视频在线观看 | 成人免费观看男女羞羞视频 | 在线观看成年视频 | www.三级| 精品一级 | 99久久免费精品视频 | 欧美日韩中文在线 | 久久久久久国产精品免费免费男同 | 国产欧美日韩精品一区二区三区 | 欧美国产日韩一区二区三区 |