久久久久久久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 錯誤:跨源請求僅支持協議方案:http、dat

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

          <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 錯誤:跨源請求僅支持協議方案:http、data、chrome-extension、https的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個非常簡單的 Angular js 應用程序的三個文件

                  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/

                  推薦答案

                  出現此錯誤是因為您只是直接從瀏覽器打開 html 文檔.要解決此問題,您需要從網絡服務器提供代碼并在 localhost 上訪問它.如果您有 Apache 設置,請使用它來提供文件.一些 IDE 內置了 Web 服務器,例如 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 設置,那么您可以使用 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.

                  這篇關于AngularJS 錯誤:跨源請求僅支持協議方案:http、data、chrome-extension、https的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  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. 主站蜘蛛池模板: 国产欧美日韩一区二区三区 | 午夜天堂精品久久久久 | 久草在线 | 一久久久| www.久久 | 日韩中文字幕一区 | 久在线视频 | 成人免费视频网站在线看 | 精品视频在线观看 | 色综合久久天天综合网 | 国产夜恋视频在线观看 | 中文字幕啪啪 | 91九色视频 | 国产日韩久久 | 91 在线 | 在线色网| 国产精品久久久久久久久久久新郎 | 精品成人佐山爱一区二区 | 91视频a| 麻豆av在线免费观看 | 日本超碰在线 | 成人精品系列 | 日本黄色大片免费看 | 日韩电影一区二区三区 | 亚洲国产成人精品女人久久久 | 韩国成人在线视频 | 精品国产青草久久久久96 | 欧美日韩91| 皇色视频在线 | 国产资源在线播放 | 日本涩涩视频 | 色天天综合 | 国内精品久久精品 | 午夜日韩 | 久久国产精品免费一区二区三区 | 欧美一级二级在线观看 | 97精品超碰一区二区三区 | 天天夜干 | 国产精品久久久久久久久久不蜜臀 | 亚洲精品乱码久久久久v最新版 | 99精品欧美一区二区蜜桃免费 |