【发布时间】:2010-08-14 08:37:07
【问题描述】:
我正在使用这个 combine.php file,它看起来不错,但我想知道是否有解决我的问题的方法。
现在我的资源的脚本和链接标签更少了,它们看起来和工作起来都像他们应该的那样
<script type="text/javascript" src="http://path/to/server/javascript/libjs/jqueryui/1.8/development-bundle/ui/minified/jquery.ui.core.min.js,libjs/jqueryui/1.8/development-bundle/ui/minified/jquery.ui.widget.min.js,libjs/jqueryui/1.8/development-bundle/ui/minified/jquery.ui.datepicker.min.js,libjs/plugins/cluetip/1.0.6/jquery.cluetip.js,libjs/plugins/cluetip/1.0.6/lib/jquery.hoverIntent.js,libjs/plugins/cluetip/1.0.6/lib/jquery.bgiframe.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://path/to/server/css/libjs/jqueryui/1.8/development-bundle/themes/base/jquery.ui.core.css,libjs/jqueryui/1.8/development-bundle/themes/base/jquery.ui.theme.css,libjs/jqueryui/1.8/development-bundle/themes/base/jquery.ui.datepicker.css,libjs/plugins/cluetip/1.0.6/jquery.cluetip.css" >
但是,包含在具有相对路径的样式表中的图像有时不会出现 - 这取决于包含样式表的顺序,即:
background: url(images/ui-bg_flat_75_ffffff_40x100.png)
我正在处理的具体罪魁祸首必须处理 jqueryui datepicker 脚本和 cluetip 脚本。
日期选择器的图像具有像这样的请求 url
http://path/to/server/css/libjs/jqueryui/1.8/development-bundle/themes/base/jquery.ui.core.css,libjs/jqueryui/1.8/development-bundle/themes/base/jquery.ui.theme.css,libjs/jqueryui/1.8/development-bundle/themes/base/jquery.ui.datepicker.css,libjs/plugins/cluetip/1.0.6/images/ui-bg_flat_75_ffffff_40x100.png
图像认为路径来自最后包含的脚本 (libjs/plugins/cluetip/1.0.6/),而实际上它来自早期脚本 (libjs/jqueryui/1.8/development-bundle/themes/base/ )
我不想将任何外部资源更改为绝对路径。这个问题有解决方法吗?有没有更好的方法来处理这种情况?
【问题讨论】:
标签: php javascript css .htaccess