简体   繁体   中英

Showing 404 status for JavaScript file path in master page of asp.net

I am giving the JavaScript file path perfectly in master page of asp.net but then also in browser console showing the error of status 404 in JavaScript path ie in short the browser not getting the path of the JavaScript file.

Here is my code

<script async="" src="index/analytics.js.download"></script>
    <script type="text/javascript" src="index/modernizr.js.download"></script>
    <script type="text/javascript" src="index/jquery-1.10.1.min.js.download"></script>
    <script type="text/javascript" src="index/jquery.dlmenu.js.download"></script>
    <script type="text/javascript" src="index/waypoints.min.js.download"></script> 
    <script type="text/javascript" src="index/jquery.counterup.min.js.download"></script> 
    <script type="text/javascript" src="index/owl.carousel.js.download"></script> 
    <script type="text/javascript" src="index/viewportchecker.js.download"></script>
    <script type="text/javascript" src="index/bootstrap.min.js.download"></script>
    <script type="text/javascript" src="index/transit.js.download"></script>
    <script type="text/javascript" src="index/jquery.simpleslider.js.download"></script>
    <script type="text/javascript" src="index/backstretch.js.download"></script>
    <script type="text/javascript" src="index/custom.js.download"></script>
    <script type="text/javascript" src="index/jquery.flexisel.js.download"></script>
    <script type="text/javascript" src="index/classie.js.download"></script>

Now, all this JavaScript file path is correct but then also I really confused that why browser console showing this type of error that status:

404 javascript file not found.

first of, double check your js path is correct

if you are sure they are correct, use relative path to the root of site by adding ~/ - otherwise you will be relative to current page which may have caused your problem

for example:
<script async="" src="index/analytics.js.download"></script>
becomes
<script async="" src="~/index/analytics.js.download"></script>

if above two step still not solve your problem, please show the exact url console is not finding and your actual local path of file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM