admin管理员组文章数量:1391969
There are link problems when loading resources. Can't figure out why.
I have a song-history.js file in /component folder and I'm trying to load it:
<script src="/components/song-history.js" type="text/javascript"></script>
But I'm getting an error :
GET http://localhost:8080/components/song-history.js net::ERR_ABORTED 404 (Not Found)
The same with images that are /icons folder.
<img id="img" src="/icons/up.png">
And I'm getting:
GET http://localhost:8080/icons/equal.png 404 (Not Found)
Here's my directory structure:
I tried renaming folders, moving them, moving files to the root - nothing helped. When I'm trying to open links, e.g. http:// localhost:8080/icons/re.png I get the message
Type Status Report
Message JSP file [/icons/main.jsp] not found
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
I'm not sure why it's even searching for main.jsp there.
Can anyone help? :)
UPD: I replaced
<script src="/components/song-history.js" type="text/javascript"></script>
with
<script type="text/javascript"><%@include file="/components/song-history.js"%></script>
and it worked, but I don't know what's wrong with the first way and how to make it work with images.
本文标签: javascriptFailed to load resource 404 error Can39t load images or js filesStack Overflow
版权声明:本文标题:javascript - Failed to load resource. 404 error. Can't load images or js files - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744652655a2617778.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论