How to include js in magento?



How to include js in magento?..

Answer / Rohit Bhatnagar

In Magento, you can include JavaScript by following these steps:
1. Create or edit a JS file in your custom module's View > js folder.
2. Define the script within the module's di.xml file.
3. Register the script in the layout XML file (e.g., default_head_blocks.xml).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Magento PHP Interview Questions

Explain how to write custom sql query in magento?

1 Answers  


How can you add an external javascript/ css file to magento?

1 Answers  


How to add a home link to the menu bar?

1 Answers  


Explain magento versions and license?

1 Answers  


How good is magento?

1 Answers  


what is the benefit of applying Connect Patches in Magento?

1 Answers  


how you can move Magento to another Directory?

1 Answers  


Who created magento?

1 Answers  


What is magento integration?

1 Answers  


What is ecommerce platform?

1 Answers  


How much does magento cost per month?

1 Answers  


What is tax rule in magento?

1 Answers  


Categories