Javascript 显示对话框时缺少jquery ui图标

Javascript 显示对话框时缺少jquery ui图标,javascript,jquery,jquery-ui,Javascript,Jquery,Jquery Ui,在我的spring/maven项目中,我在jQueryUI对话框中打开每个子页面。问题是当显示窗口时,关闭按钮的图标丢失,如下所示: jquery中的文件通过以下两个jsp文件包含在我的项目的每个页面中: header.jsp <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ page session="false

在我的spring/maven项目中,我在jQueryUI对话框中打开每个子页面。问题是当显示窗口时,关闭按钮的图标丢失,如下所示:

jquery中的文件通过以下两个jsp文件包含在我的项目的每个页面中:

header.jsp

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page session="false" language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<html>
<head>
<title>${param.name}</title>

<link href="${pageContext.servletContext.contextPath}/resources/jquery/css/custom/jquery-ui-1.10.4.custom.min.css" rel="stylesheet">
<link href="${pageContext.servletContext.contextPath}/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.servletContext.contextPath}/resources/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">

<link href="${pageContext.servletContext.contextPath}/resources/extra/css/starter-template.css" rel="stylesheet">
<link href="${pageContext.servletContext.contextPath}/resources/extra/css/signin.css" rel="stylesheet">
<link href="${pageContext.servletContext.contextPath}/resources/extra/css/table.css" rel="stylesheet">

</head>
<body>
<script src="${pageContext.servletContext.contextPath}/resources/jquery/js/jquery-2.1.1.min.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/jquery/js/jquery-ui-1.10.4.custom.min.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/bootstrap/js/bootstrap.min.js"></script>

<script src="${pageContext.servletContext.contextPath}/resources/extra/js/jquery.md5.min.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/extra/js/form_submit.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/extra/js/form_valida.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/extra/js/page_link.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/extra/js/page_load.js"></script>

</body>
</html>

${param.name}
footer.jsp

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page session="false" language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<html>
<head>
<title>${param.name}</title>

<link href="${pageContext.servletContext.contextPath}/resources/jquery/css/custom/jquery-ui-1.10.4.custom.min.css" rel="stylesheet">
<link href="${pageContext.servletContext.contextPath}/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.servletContext.contextPath}/resources/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">

<link href="${pageContext.servletContext.contextPath}/resources/extra/css/starter-template.css" rel="stylesheet">
<link href="${pageContext.servletContext.contextPath}/resources/extra/css/signin.css" rel="stylesheet">
<link href="${pageContext.servletContext.contextPath}/resources/extra/css/table.css" rel="stylesheet">

</head>
<body>
<script src="${pageContext.servletContext.contextPath}/resources/jquery/js/jquery-2.1.1.min.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/jquery/js/jquery-ui-1.10.4.custom.min.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/bootstrap/js/bootstrap.min.js"></script>

<script src="${pageContext.servletContext.contextPath}/resources/extra/js/jquery.md5.min.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/extra/js/form_submit.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/extra/js/form_valida.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/extra/js/page_link.js"></script>
<script src="${pageContext.servletContext.contextPath}/resources/extra/js/page_load.js"></script>

</body>
</html>

我的项目中的文件层次结构如下:

当我打开页面时,浏览器的网络监视器(我使用的是firefox)会显示以下内容:

我觉得奇怪的是文件的状态:ui-icons\u000000\u256x240.png
304未修改
,但我认为应该是
200 Ok


这真的是个问题吗?如果是这样的话,如何解决这个问题?

您使用的是来自CDN、google等的jQuery-ui.js文件吗。。或者其他服务器

请检查您的jquery-ui.js和jquery-ui.css是否来自其他url 或者他们都在当地

如果它们来自同一地点,则检查以下步骤,如果否,则请将两者的来源相同

F12在Firefox中->选择“网络”选项卡->选择“所有”选项卡

并检查精灵图像的响应

如果它无法加载图像,则会有一个链接作为响应 只需将该链接与项目文件夹层次结构进行比较

它将帮助您找到图像的正确路径

还要检查图像url是本地目录还是
图像来自其他服务器/URL

我怀疑,由于jQuery ui css文件使用到图像文件夹的相对路径,图标图像ui-icons\uu000000\u256x240.png不是css文件的相对路径

因此,我建议您注释掉jQuery ui js和css文件的服务器路径,并使用cdn位置,如下所示:

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>


对于测试,如果这是路径问题,您可以尝试这个想法

几周前,我在一个对话框窗口中遇到了类似的问题解决方案是从以下位置升级图标:

..www/css/images/icons-png/ 
..www/css/images/icons-svg/
要在我的服务器上复制
.css
.js
和图标,并且不要从外部源下载!然后从以下位置验证您的路径:

jquery-ui 
jquery.inline-png.css
jquery.inline-svg.css

304未修改
仅表示自浏览器上次请求资源后,该资源未被修改,因此无需接收新文件。@RevanProdigalKnight但为什么图像未显示在我的页面中?ui-icons\u 000000\u 256x240.png是否在resources/jquery/js/images/?中?否,它位于
resources/jquery/css//images
中,请提供一个指向该网页的链接或创建一些代码。