gpt4 book ai didi

javascript - net::ERR_EMPTY_RESPONSE 尝试在 angularjs 指令中查找 css 文件时

转载 作者:行者123 更新时间:2023-11-28 06:19:29 25 4
gpt4 key购买 nike

当我的网页试图从指令访问我的 css 文件时,我收到了 net::ERR_EMPTY_RESPONSE

我正在使用 door3 的按需 css,它允许您仅在需要时延迟加载 css 文件。这在我的路由文件中完美运行,但在我的指令文件中,它在 Chrome 中获取了 net::ERR_EMPTY_RESPONSE。这是 door3 的文档:http://door3.com/insights/introducing-angularcss-css-demand-angularjs#.VtPeDygrKM8

在研究这个错误时,我发现有人建议它可能是我的广告拦截器,所以我将其关闭但没有任何改变。我在 StackOveflow 或谷歌上找不到与我的问题类似的任何其他内容。我加倍检查了 css 文件的名称和路径,一切看起来都不错。可能是什么原因造成的?

这是我的 app.js 文件,它从 door3 按需配置 css:

angular.module('task2', ['ngRoute', 'ngResource', 'door3.css'])
.config(function($cssProvider) {
angular.extend($cssProvider.defaults, {
persist: true,
preload: true,
bustCache: true
});
});

这是我收到错误的指令,section1.js:

angular.module('task2')
.directive('section1', function() {
return {
restrict: 'E',
templateUrl: 'partials/home/section1.html',
controller: function() {
this.getLogo = function() {
return logoImage;
};
this.brandName = "Geek Label";

this.section1Desc = "A team of self confessed geeks who are all about great digital design";
},
controllerAs: 'section1Ctrl',
css: 'css/partials/home/section1.css'
};
});

var logoImage = {
name: 'eyeglasses logo',
url: 'content/images/eyeglassesLogo.png'
};

这是关联的 css 文件,section1.css:

#section1Row {
width: 100%;
}

#section1 {
height: 100vh;/*100% of viewport height*/
background-color: #D9435E;
position: relative;
}

这是具有关联的 css 文件的路由文件,routes.js:

//Routes
angular.module('task2')
.config(function($routeProvider) {
$routeProvider.
when('/home', {
templateUrl: 'partials/home/home.html',
name: "Home",
controller: 'HomeController',
controllerAs: "homeCtrl",
css: 'css/partials/home/home.css'
}).
otherwise({
redirectTo: '/home'
});
});

我在 Chrome 中收到以下错误:获取 http://localhost:8383/CompucorpTask2/n?cache=1456723626330 net::ERR_EMPTY_RESPONSE

最佳答案

未提供 Css 文件 .. 这就是错误的含义。尝试检查它们是否位于服务器端的正确文件夹中。

关于javascript - net::ERR_EMPTY_RESPONSE 尝试在 angularjs 指令中查找 css 文件时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35692753/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com