I am developing a module. I am new in module development.
Now I need to know how to add JavaScript file when someone developing a module ??
The conditions are as below:
1. When the module installed then the JavaScript file will be loaded.
2. When the module uninstalled then the JavaScript file will be not loaded.
3. When the module disabled through XML file of app/etc/modules directory then the JavaScript file will be not loaded.
4. When the module disabled through enable/disable option of the module then the JavaScript file will be not loaded.
Thanks
When you create your own extension one thing you want to do is to declare a layout file. In the layout file you can define layout updates, such as additional JS/CSS files to be loaded. The page I linked explains some of those things.