找不到文件jquery-ui.css的页面

时间:2013-06-16 05:26:30

标签: jquery dialog http-status-code-404

我需要在按钮上单击显示一个对话框,我为此选择了jquery,但我面临以下错误:

1. GET http://localhost:8080/ReportFetcher/WebContent/WEB-INF/lib/jquery-ui-themes-1.10.3/themes/smoothness/jquery-ui.css 404 (Not Found) 
2. GET http://localhost:8080/ReportFetcher/WebContent/WEB-INF/lib/jquery-1.10.1.js 404 (Not Found) 
3. GET http://localhost:8080/ReportFetcher/WebContent/WEB-INF/lib/jquery-ui.js 404 (Not Found)
4. GET http://localhost:8080/resources/demos/style.css 404 (Not Found)

我在这个项目中放置这些文件的位置是:    / ReportFetcher --->的WebContent ---> WEBINF - > LIB ---> (这里我放置了上面提到的所有文件和文件夹(jquery-ui-themes-1.10.3 / themes)。

我无法理解为什么浏览器没有获得上述资源。

<head>
<link rel="stylesheet"
    href="/ReportFetcher/WebContent/WEB-INF/lib/jquery-ui-themes-1.10.3/themes/smoothness/jquery-ui.css" />
<script src="/ReportFetcher/WebContent/WEB-INF/lib/jquery-1.10.1.js"></script>
<script src="/ReportFetcher/WebContent/WEB-INF/lib/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />

<script language="javascript">
    $(document).ready(function() {
        $("#trail").click(function() {
            $("#dialog").dialog();
        });
    });
....
some more code here

当我使用

  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css" />
一切顺利。 但我的应用程序也应该在没有互联网连接的情况下工作。

1 个答案:

答案 0 :(得分:1)

添加

<link rel="stylesheet" href="jquery-ui-themes-1.10.3/themes/smoothness/jquery-ui.css" />
<script src="jquery-1.10.1.js"></script>
<script src="jquery-ui.js"></script>script src="jquery-1.9.1.min.js"></script>

并将文件放在

  

的WebContent

为我解决了这个问题。

参考this进行一些解释