1

This question already has an answer here:

How to change js and css order in xml file? i want add js and css in footer or last in header.?

I want to change js order in product view page?

 <reference name="head">

    <action method="addItem">

            <type>skin_js</type>

            <name>js/jquery.js</name>

        </action>

        <action method="addItem">

            <type>skin_js</type>

            <name>js/cloud-zoom.1.0.2.min.js</name>

        </action>

i want to chanage order of this js this js added last or footer can any idea of to change order to js

marked as duplicate by Marius, Keyul Shah, Fabian Blechschmidt, Rajeev K Tomy, David Manners Oct 28 '14 at 9:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • i want add js in footer and last of all js? – coder Oct 28 '14 at 7:50
1

You can't add the js files at the end of page (just before body) in magento (not with the default functionality).

However you can change the order of the js files being loaded.

<action method="addItem">

        <type>skin_js</type>

        <name>js/jquery.js</name>

    </action>

    <action method="addItem">

        <type>skin_js</type>

        <name>js/cloud-zoom.1.0.2.min.js</name>

    </action>

Will load jquery first then cloud-zoom, and

 <action method="addItem">

        <type>skin_js</type>

        <name>js/cloud-zoom.1.0.2.min.js</name>

    </action>
  <action method="addItem">

        <type>skin_js</type>

        <name>js/jquery.js</name>

    </action>

Will load cloud-zoom first and then jquery.

Not the answer you're looking for? Browse other questions tagged or ask your own question.