2012-12-31 60 views

回答

1

在你的主题布局目录中创建local.xml文件,并把你这样的代码,把你的JS文件在这里“/护肤/前端/接口/主题/ JS /” 。如果您使用addjs方法,则必须将您的js文件放在“您的magento root/js /”文件夹下。这是一个例子。

<?xml version="1.0"?> 
<layout version="0.1.0"> 
<default> 
    <reference name="head"> 
     <!-- Magento looks in /skin/frontend/<INTERFACE>/<THEME>/js/buyprinting.js 
     for this file --> 
     <action method="addItem"><type>skin_js</type><name>js/buyprinting.js</name></action> 
     <!-- This removes the item that was set in the page.xml file --> 
     <action method="removeItem"><type>skin_js</type><name>js/iehover-fix.js</name></action> 

     <!-- Magento looks in /js/prototype/element.storage.js for this file --> 
     <action method="addJs"><name>prototype/element.storage.js</name></action> 

    </reference> 
</default> 
</layout> 

注: 如果仍不能确定在哪里放置你的js文件到你的浏览器,然后单击查看源文件。这里检查你的js文件并相应地放置js文件。

+0

他在谈论adminhtml :) –

2

如果你是在谈论adminhtml为你写的,然后把它放在js/my_extension/