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 type="text/javascript" src="index/analytics.js"></script>
<script type="text/javascript" src="index/modernizr.js"></script>
<script type="text/javascript" src="index/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="index/jquery.dlmenu.js"></script>
<script type="text/javascript" src="index/waypoints.min.js"></script>
<script type="text/javascript" src="index/jquery.counterup.min.js"></script>
<script type="text/javascript" src="index/owl.carousel.js"></script>
<script type="text/javascript" src="index/viewportchecker.js"></script>
<script type="text/javascript" src="index/bootstrap.min.js"></script>
<script type="text/javascript" src="index/transit.js"></script>
<script type="text/javascript" src="index/jquery.simpleslider.js"></script>
<script type="text/javascript" src="index/backstretch.js"></script>
<script type="text/javascript" src="index/custom.js"></script>
<script type="text/javascript" src="index/jquery.flexisel.js"></script>
<script type="text/javascript" src="index/classie.js"></script>
Now this JS file is in index folder only, but then also I really confused that why browser console showing this type of error that status:
404 javascript file not found.
Image:
您可以尝试使用类似ResolveUrl()方法的方法来引用jQuery库,以确保其定位到正确的位置:
<script src="<%= ResolveUrl("~/index/jquery-1.10.1.min.js") %>" type="text/javascript"></script>
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.