jquery datetimepicker 给出 404 not found (.png files) 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9341794/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 10:40:43  来源:igfitidea点击:

jquery datetimepicker gives 404 not found (.png files) error

jqueryjquery-uijquery-plugins

提问by aacanakin

I'am using thisdatetimepicker on my website. My html file includes .js and .css files ;

我在我的网站上使用这个日期时间选择器。我的 html 文件包括 .js 和 .css 文件;

<link rel="stylesheet" type="text/css" href="asts/css/style.css">           
<script type="text/javascript" src="asts/js/modernizr.2.0.6.js"></script>
<script type="text/javascript" src="asts/js/jquery_1.7.1.js" ></script>
<script type="text/javascript" src="asts/js/jquery-ui-1.8.17.custom.min.js" ></script>  
<script type="text/javascript" src="asts/js/jquery-ui-timepicker-addon.js" ></script>
<script type="text/javascript" src="asts/js/jquery.ui.slider.js" ></script> 
<script type="text/javascript" src="asts/js/gonnasphere.js" ></script>

Also, I've imported the css files of custom minified package and datetime-picker-addon by @import url statement. I've also included the css/images folder with necessary icons.

另外,我已经通过@import url 语句导入了自定义缩小包和 datetime-picker-addon 的 css 文件。我还包含了带有必要图标的 css/images 文件夹。

When I click the text field, the jquery ui plugin works correctly. All the functions and ui works. However, firebug gives me the following network errors ;

当我单击文本字段时,jquery ui 插件工作正常。所有功能和用户界面都有效。但是,firebug 给了我以下网络错误;

Can you please help me to prevent getting this error ?

你能帮我防止这个错误吗?

回答by aacanakin

I've figured out the problem. It was a folder fault. When I changed the file paths of .png files in the jquery-ui-1.8.17.custom.cssfile, it doesn't show any error.

我已经想通了问题所在。这是文件夹错误。当我更改文件中 .png 文件的文件路径时 jquery-ui-1.8.17.custom.css,它没有显示任何错误。

Before I changed, it was ;

在我改变之前,它是;

url(images/ui-bg_inset-soft_50_c9c9c9_1x100.png)

After ;

后 ;

url(../images/ui-bg_inset-soft_50_c9c9c9_1x100.png)

回答by Alex K.

Those are jQueryUI assets, probably used by jquery.ui.slider.js.

这些是 jQueryUI 资产,可能由 jquery.ui.slider.js 使用。

Download the slider (+ its dependencies) from http://jqueryui.com/downloadand you will find the required CSS & images in \css\<selected-theme>

http://jqueryui.com/download下载滑块(+ 其依赖项),您将在以下位置找到所需的 CSS 和图像\css\<selected-theme>

回答by Chleo

I had the same problem, I need to download the the JQueryUI assets and put the images folder in the stylesheets folder. I was using the .min files and had to switch for the non min one. It fixed my problem.

我遇到了同样的问题,我需要下载 JQueryUI 资产并将图像文件夹放在样式表文件夹中。我正在使用 .min 文件,不得不切换到非 min 文件。它解决了我的问题。