pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <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="8esjqvl" 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="83mzym7" 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="urqsrat" id='F0biC'><tfoot id='F0biC'></tfoot><dl id='F0biC'><fieldset id='F0biC'></fieldset></dl></div>

                          1. 主站蜘蛛池模板: 合肥升降机-合肥升降货梯-安徽升降平台「厂家直销」-安徽鼎升自动化科技有限公司 | 高清视频编码器,4K音视频编解码器,直播编码器,流媒体服务器,深圳海威视讯技术有限公司 | 安全阀_弹簧式安全阀_美标安全阀_工业冷冻安全阀厂家-中国·阿司米阀门有限公司 | 杭州中策电线|中策电缆|中策电线|杭州中策电缆|杭州中策电缆永通集团有限公司 | 层流手术室净化装修-检验科ICU改造施工-华锐净化工程-特殊科室建设厂家 | 考勤系统_考勤管理系统_网络考勤软件_政企|集团|工厂复杂考勤工时统计排班管理系统_天时考勤 | 连续密炼机_双转子连续密炼机_连续式密炼机-南京永睿机械制造有限公司 | 进口试验机价格-进口生物材料试验机-西安卡夫曼测控技术有限公司 | 披萨石_披萨盘_电器家电隔热绵加工定制_佛山市南海区西樵南方综合保温材料厂 | 找培训机构_找学习课程_励普教育 | 定制/定做衬衫厂家/公司-衬衫订做/订制价格/费用-北京圣达信 | 艾默生变频器,艾默生ct,变频器,ct驱动器,广州艾默生变频器,供水专用变频器,风机变频器,电梯变频器,艾默生变频器代理-广州市盟雄贸易有限公司官方网站-艾默生变频器应用解决方案服务商 | 北京网站建设首页,做网站选【优站网】,专注北京网站建设,北京网站推广,天津网站建设,天津网站推广,小程序,手机APP的开发。 | 网优资讯-为循环资源、大宗商品、工业服务提供资讯与行情分析的数据服务平台 | 南京和瑞包装有限公司| 郑州墨香品牌设计公司|品牌全案VI设计公司 | 开平机_纵剪机厂家_开平机生产厂家|诚信互赢-泰安瑞烨精工机械制造有限公司 | 广西正涛环保工程有限公司【官网】| LED显示屏_LED屏方案设计精准报价专业安装丨四川诺显科技 | 一体化预制泵站-一体化提升泵站-一体化泵站厂家-山东康威环保 | 聚氨酯催化剂K15,延迟催化剂SA-1,叔胺延迟催化剂,DBU,二甲基哌嗪,催化剂TMR-2,-聚氨酯催化剂生产厂家 | 双齿辊破碎机-大型狼牙破碎机视频-对辊破碎机价格/型号图片-金联机械设备生产厂家 | AR开发公司_AR增强现实_AR工业_AR巡检|上海集英科技 | NMRV减速机|铝合金减速机|蜗轮蜗杆减速机|NMRV减速机厂家-东莞市台机减速机有限公司 | 南京展台搭建-南京展会设计-南京展览设计公司-南京展厅展示设计-南京汇雅展览工程有限公司 | 黑龙江「京科脑康」医院-哈尔滨失眠医院_哈尔滨治疗抑郁症医院_哈尔滨精神心理医院 | 河南中专学校|职高|技校招生-河南中职中专网 | 造价工程师网,考试时间查询,报名入口信息-网站首页 | 耙式干燥机_真空耙式干燥机厂家-无锡鹏茂化工装备有限公司 | 江西自考网 | 综合管廊模具_生态,阶梯护坡模具_检查井模具制造-致宏模具厂家 | Copeland/谷轮压缩机,谷轮半封闭压缩机,谷轮涡旋压缩机,型号规格,技术参数,尺寸图片,价格经销商 CTP磁天平|小电容测量仪|阴阳极极化_双液系沸点测定仪|dsj电渗实验装置-南京桑力电子设备厂 | 深圳货架厂_仓库货架公司_重型仓储货架_线棒货架批发-深圳市诺普泰仓储设备有限公司 | 电地暖-电采暖-发热膜-石墨烯电热膜品牌加盟-暖季地暖厂家 | 蓝莓施肥机,智能施肥机,自动施肥机,水肥一体化项目,水肥一体机厂家,小型施肥机,圣大节水,滴灌施工方案,山东圣大节水科技有限公司官网17864474793 | NBA直播_NBA直播免费观看直播在线_NBA直播免费高清无插件在线观看-24直播网 | 艺术涂料_进口艺术涂料_艺术涂料加盟_艺术涂料十大品牌 -英国蒙太奇艺术涂料 | 一体化预制泵站-一体化提升泵站-一体化泵站厂家-山东康威环保 | 环保袋,无纺布袋,无纺布打孔袋,保温袋,环保袋定制,环保袋厂家,环雅包装-十七年环保袋定制厂家 | 升降炉_真空气氛炉_管式电阻炉厂家-山东中辰电炉有限公司 | 最新电影-好看的电视剧大全-朝夕电影网|