[英]Error while running angular js html page on a server
When I'm running my HTML page through a server I'm always getting an error with my angular JavaScript file included. 当我通过服务器运行HTML页面时,包含的角度JavaScript文件总是出现错误。 But it runs fine without local server in Mozilla Firefox and Safari but not with Google Chrome (XML errors with Google Chrome).
但在Mozilla Firefox和Safari中没有本地服务器的情况下,它运行良好,但在Google Chrome浏览器中则无法运行(Google Chrome浏览器出现XML错误)。
//localhost:8000/Users/harsha/Documents/angular%20js/nganimate.js
//localhost:8000/Users/harsha/Documents/angular%20js/nganimate.js
Failed to load resource: the server responded with a status of 404 (File not found)加载资源失败:服务器响应状态为404(找不到文件)
Failed to load resource: the server responded with a status of 404 (File not found) angular.js:4361Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.0/ $injector/modulerr?p0=controllerapp&p1=Er…ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.4.0%2Fangular.min.js%3A19%3A264)无法加载资源:服务器响应状态为404(找不到文件)angular.js:4361未捕获的错误:[$ injector:modulerr] http://errors.angularjs.org/1.4.0/ $ injector / modulerr? p0 = controllerapp&p1 = Er ... ogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.4.0%2Fangular.min.js%3A19%3A264)
The Screenshot of error message in console 控制台中错误消息的屏幕截图
You have error in js file path . js文件路径错误。
//localhost:8000/Users/harsha/Documents/angular%20js/nganimate.js
So index file is unable to locate the file. 因此索引文件无法找到该文件。
Users/harsha/Documents/angular%20js/nganimate.js
用户/harsha/Documents/angular%20js/nganimate.js
The path of your server isn't the one from your C: it's relative from where your start your server. 服务器的路径不是C语言中的路径:它是服务器启动位置的相对路径。 If you need us to figure out from where your server start, you need to tell us what is the server.
如果您需要我们弄清楚服务器从何处开始,则需要告诉我们什么是服务器。
And if it's the grunt web server, show us your build file. 如果这是一个笨拙的Web服务器,请向我们显示您的构建文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.