相对包含的脚本,但显示未找到错误

时间:2018-07-13 08:46:47

标签: javascript php smarty

我有一个smarty-test01聪明的项目。

在我的templates/index2.tpl中:

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>dialog</title>
    <!--jquery-->
    <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
    <script language="javascript" type="text/javascript" src="../libs/jquery-ui-1.9.2.custom/js/jquery-ui-1.9.2.custom.min.js"></script> // you see there I import the jquery-ui.
    <!--Css-->
    <link rel="stylesheet" href="../libs/jquery-ui-1.9.2.custom/css/base/jquery-ui-1.9.2.custom.min.css" />
    <script language="javascript" type="text/javascript">
    ...

我导入了jquery-ui和jquery-ui-css。

但是当我访问http://localhost:63342/smarty-test01/index2.php时,浏览器会显示“未找到jquery-ui及其样式表”。我确定相对​​路径正确。

enter image description here


目录树:

.
├── CONSTANTS.php
├── cache
├── configs
│   └── constants.php
├── htdocs
│   ├── index.php
│   └── index2.php
├── index.php
├── index2.php
├── libs
│   └── jquery-ui-1.9.2.custom
│       ├── css
│       │   └── base
...
│       │   └── ui.widget.jquery.json
│       ├── index.html
│       └── js
│           ├── jquery-1.8.3.js
│           ├── jquery-ui-1.9.2.custom.js
│           └── jquery-ui-1.9.2.custom.min.js
├── smarty.php
├── templates
│   ├── index.tpl
│   └── index2.tpl
└── templates_c
    ├── 8b747b0f978b4e5206c429d91816c400edfe7ec5_0.file.index2.tpl.php
    ├── 976090f2d104294efca669338810dea6bf8e1484_2.file.debug.tpl.php
    └── aac75150379166297487ae8ee5a1de73ee3e89c7_0.file.index.tpl.php

EDIT-1

因为在phpStorm中,编辑器没有显示这是错误的路径,所以这很奇怪。我也尝试了绝对路径。

1 个答案:

答案 0 :(得分:0)

目录中是否有任何默认CSS文件?如果是这样,则将其删除或重命名,看看是否获得预期的结果。

或者,您也可以尝试以下操作:

/../libs/jquery-ui-1.9.2.custom/css/base/jquery-ui-1.9.2.custom.min.css"