Where / how to add custom js magento

I created a magento module and I need to add custom javascript.

I put the following in my layout file (and it works with my js places in / js /):

<default>
    <reference name="head">
        <action method="addJs"><script>http://code.jquery.com/jquery.min.js</script></action>
        <action method="addJs"><script>my_custom_js.js</script></action>
    </reference>
</default>

My question is: where is the best place for these files, in /js/jquery/or in /skin/frontend/default/default/js? If I put it in default / default, how do I reference it from XML?

+5
source share
1 answer

If necessary for your module (critical functionality):

/js/[namespace]/[module]/

If required for a theme (user interface extension):

/skin/frontend/[group]/[theme]/js/
+12
source

All Articles