How to load javascript on specific page only

Possible duplicate : How to include Javascript in xml-document?

How would I load a javascript file only only checkout pages? We are using onepage checkout. I have tried adding

            <action method="addJs">

To various places on checkout.xml with no success

One thought on “How to load javascript on specific page only”

  1. The page frame for the onepage checkout is loaded in the initial action. Try something like this:

        <reference name="head">  
             <action method="addItem"><type>skin_js</type><name>js/myscript.js</name></action>

    Then place your script in your skin directory under /js.

    Hope that helps!


Leave a Reply

Your email address will not be published. Required fields are marked *