I am modifying a Magento theme. And want to add a js file into the theme /js
folder. I have added the following code:
Best solution insert into local.xml file with reference name="head"
<action method="addJs">
<script>js/custom.js</script>
</action>
Please try this, i think this is the way to add our js/css files into the load.xml:
<layout>
<default>
<reference name="head">
<action method="addItem">
<type>skin_js</type>
<name>js/jquery-1.11.0.min.js</name>
</action>
</reference>
</default>
</layout>
You can add your custom JS file in your theme's local.xml
, located in: /app/design/frontend/{design package}/{theme}/layout/local.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/script_name.js</name></action>
</reference>
</default>
</layout>