来自皮肤目录的js文件未在Magento中加载

时间:2014-06-14 06:35:22

标签: magento skin

我正在尝试将magento用于电子商务。

因为我刚刚添加了一些js文件,这些文件保存在skin \ frontend \ default \ mytheme \ js上。

这是我的代码:

<block type="page/html_head" name="head" as="head">
<action method="addJs"><script>prototype/prototype.js</script></action>
<action method="addJs"><script>lib/ccard.js</script></action>
<action method="addJs"><script>prototype/validation.js</script></action>
<action method="addJs"><script>scriptaculous/builder.js</script></action>
<action method="addJs"><script>scriptaculous/effects.js</script></action>
<action method="addJs"><script>scriptaculous/dragdrop.js</script></action>
<action method="addJs"><script>scriptaculous/controls.js</script></action>
<action method="addJs"><script>scriptaculous/slider.js</script></action>
<action method="addJs"><script>varien/js.js</script></action>
<action method="addJs"><script>varien/form.js</script></action>
<action method="addJs"><script>varien/menu.js</script></action>
<action method="addJs"><script>mage/translate.js</script></action>
<action method="addJs"><script>mage/cookies.js</script></action>
<action method="addJs"><script>jscommon/jquery.min.js</script></action>
<block type="page/js_cookie" name="js_cookies" template="page/js/cookie.phtml"/>
<action method="addCss"><stylesheet>css/styles_default.css</stylesheet></action>
<action method="addCss"><stylesheet>css/styles.css</stylesheet></action>
<action method="addCss"><stylesheet>css/style.css</stylesheet></action>
<action method="addCss"><stylesheet>css/dd.css</stylesheet></action>
<action method="addCss"><stylesheet>css/styles.css</stylesheet></action>
<action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action>
<action method="addCss"><stylesheet>css/widgets.css</stylesheet></action>
<action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action>
<action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params/><if>lt IE 7</if></action>
<action method="addItem"><type>skin_js</type><name>js/ie6.js</name><params/><if>lt IE 7</if></action>
<!-- <action method="addItem"><type>skin_js</type><name>js/jquery.js</name></action> -->
<action method="addItem"><type>skin_js</type><name>js/jquery.min.js</name></action>
<action method="addItem"><type>skin_js</type><name>js/jqueryNoConf.js</name></action>
<action method="addItem"><type>skin_js</type><name>js/jquery.anythingslider.js</name></action>
<action method="addItem"><type>skin_js</type><name>js/jquery.dd.js</name></action>
<action method="addItem"><type>skin_css</type><name>css/anythingslider.css</name></action>
<!--<action method="addItem"><type>skin_js</type><name>js/scripts.js</name></action>-->
</block>

但是从这一行<action method="addItem"><type>skin_js</type><name>js/jquery.min.js</name></action>将不会在浏览器中加载任何内容。什么都没有意味着即使脚本加载网址也没有...

代码来自page.xml

C:\wamp\www\theme\app\design\frontend\default\biomatrix\template\layout

我的代码中有什么问题。

我该如何解决这个问题?

2 个答案:

答案 0 :(得分:0)

您已经提到过将js文件保存在 skin \ frontend \ default \ mytheme \ js 路径中。

并且您正在编写位于C:\ wamp \ www \ theme \ app \ design \ frontend中的page.xml中的代码** default \ biomatrix ** \ template \ layout folder

答案 1 :(得分:0)

尝试在根js文件夹中创建路径并创建一个类似prototype,lib或mage的文件夹 并用

调用它
 <action method="addJs"><script>your folder/yourjs.js</script></action>