javascript 如何解决“NetworkError: 404 Not Found - http://localhost:50765/Scripts/jquery-1.5.1.min.js”错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27540585/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to solve "NetworkError: 404 Not Found - http://localhost:50765/Scripts/jquery-1.5.1.min.js" error
提问by Nikhil Saswade
i am trying to add date picker to my textbox. i have added all needed java scripts and referenced it properly but it is giving me following error.
我正在尝试将日期选择器添加到我的文本框。我已经添加了所有需要的 java 脚本并正确引用了它,但它给了我以下错误。
"NetworkError: 404 Not Found - http:/Scripts/jquery-1.5.1.min.js"
“网络错误:404 未找到 - http:/Scripts/jquery-1.5.1.min.js”
回答by Pramod Karandikar
This problem will occur if jquery-1.5.1 is missing from script folder. Check the path for file jquery-1.5.1.min.js
. If it's a webapp you are running, it would be placed inside <webapp-root>/Scripts
. Also, as per the error it seems that you have come one extra directory back while setting the path for this file.
如果脚本文件夹中缺少 jquery-1.5.1,则会出现此问题。检查文件的路径jquery-1.5.1.min.js
。如果它是您正在运行的 web 应用程序,它将被放置在<webapp-root>/Scripts
. 此外,根据错误,您似乎在设置此文件的路径时返回了一个额外的目录。
NuGet
package to be installed using command - Install-Package jQuery -Version 1.5.1
as specified on this link.
NuGet
要使用命令安装的软件包 - 正如此链接中Install-Package jQuery -Version 1.5.1
指定的那样。
回答by sfewfed
Use this to include jQuery:
使用它来包含 jQuery:
<script src="/Scripts/jquery-1.5.1.min.js"></script>
回答by Chan Chun Weng
Add this line before <html>
tag
在<html>
标签前添加这一行
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
Then, put this code in your HTML <head></head>
然后,将此代码放入您的 HTML <head></head>
<script src='<c:url value="/Scripts/jquery-1.5.1.min.js"/>'></script>
<script src='<c:url value="/Scripts/jquery-1.5.1.min.js"/>'></script>