I am developing custom Module in Magento 1. Now I would like to load my module specific JS file when then module enabled. In this regard I used below xml code in a separate xml file named as module name which is placed inside layout folder. My module don't have any controller.

    <reference name="head">
        <action method="addJs">

But the JS file is not loading at the time of module loading.

How can I do that??

1 Answer 1


try ifconfig

<action method="addItem" ifconfig="my_config_section/general/enabeld"><type>skin_js</type><name>js/my_module/my_module.js</name></action>
  • @Qaiser Satti, Thanks for your reply. My module name is brand_logo. I placed a file in layout folder name brand_logo.xml. My requirement is when my module will be loaded then js file also be loaded. Thanks
    – abu abu
    Jun 24, 2016 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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