开发者

How to load javascript on specific page only

开发者 https://www.devze.com 2023-02-17 10:43 出处:网络
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

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">
                <script>myscript.js</script>
            </action&开发者_开发技巧gt;

To various places on checkout.xml with no success


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

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

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

Hope that helps!

Thanks, Joe

0

精彩评论

暂无评论...
验证码 换一张
取 消