Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/420.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 大括号内的文件路径_Javascript_Css_Joomla - Fatal编程技术网

Javascript 大括号内的文件路径

Javascript 大括号内的文件路径,javascript,css,joomla,Javascript,Css,Joomla,我希望是一个简短的问题 我在用Joomla!2.5.8. 我刚刚发现了eCSSential,它在index.php中使用了以下代码 <script> <!-- Add eCSSential.min.js inline here --> eCSSential({ "all": "css/all.css", "(min-width: 20em)": "css/min-20em.css", "(min-w

我希望是一个简短的问题

我在用Joomla!2.5.8. 我刚刚发现了eCSSential,它在index.php中使用了以下代码

    <script>
    <!-- Add eCSSential.min.js inline here -->

    eCSSential({
        "all": "css/all.css",
        "(min-width: 20em)": "css/min-20em.css",
        "(min-width: 37.5em)": "css/min-37.5em.css",
        "(min-width: 50em)": "css/min-50em.css",
        "(min-width: 62.5em)": "css/min-62.5em.css"
    });
 </script>

重要的({
“全部”:“css/all.css”,
“(最小宽度:20em)”:“css/min-20em.css”,
“(最小宽度:37.5em)”:“css/min-37.5em.css”,
“(最小宽度:50em)”:“css/min-50em.css”,
“(最小宽度:62.5em)”:“css/min-62.5em.css”
});
现在,在我的乔姆拉!我有这个

<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template?>/js/eCSSential.js"></script>


<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/style.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 1024px)" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/max-width-1024.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 768px)" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/max-width-758.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 524px)" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/max-width-524.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/css/lightbox.css"  type="text/css" />

为什么要使用动态模板目录?只要不切换,只需编写模板名称而不是


尝试以下几点小调整:

<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/js/eCSSential.js"></script>


<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/style.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 1024px)" href="<?php echo $this->baseurl; ?>/templates/nameoftemplate/css/max-width-1024.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 768px)" href="<?php echo $this->baseurl; ?>/templates/nameoftemplate/css/max-width-758.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 524px)" href="<?php echo $this->baseurl; ?>/templates/nameoftemplate/css/max-width-524.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/lightbox.css" type="text/css" />

确保模板文件夹名称正确

然后您可以通过以下方法访问它

<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/style.css" rel="stylesheet" type="text/css" />

or

<link href="<?php echo JURI::root(); ?>templates/<?php echo $this->template; ?>/css/style.css" rel="stylesheet" type="text/css" />

or

<link href="<?php echo JURI::root(); ?>templates/name of the template_folder/css/style.css" rel="stylesheet" type="text/css" />

您好,我尝试用模板名替换
,但仍然不起作用。我一定错过了什么<代码>“全部”:“css/all.css”
将变成<代码>“样式”:“/templates/nameoftemplate/css/style.css”,
但这不起作用。将其中任何一个替换为下面的都不起作用<代码>eCessential({“all”:“css/all.css”;(最小宽度:20em):“css/min-20em.css”;(最小宽度:37.5em):“css/min-37.5em.css”;(最小宽度:50em):“css/min-50em.css”;(最小宽度:62.5em):“css/min-62.5em.css”})