在你的主題佈局目錄中創建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文件。
他在談論adminhtml :) –