Add js File in Magento – 7 Easy to Follow Steps
In Magento CMS the easiest and recommended way to add js file is by using custom codes. Apart from including a js file, you can add and implement hosted scripts and Java Script libraries as well. Use the Java Script editor in the Theme Customization section in Magento admin panel.
How to Add js File in Magento Easily
Add js File in Magento using Custom Code
- In Magento, go Design > Themes Editor > Java Script Editor
- In the Admin panel, go to Design > Themes Editor
- Click ‘Customize’ for the theme in which the js file is to be added
- Click Browse Files to add js file in Magento from your local drive.
- Select the file and press ‘Upload Files’
- Click ‘Save’ to save the changes made
- Add all js files one by one and then upload them all at once.
- Make sure that the order of execution of the js files is correct.
If you have added multiple js files from your computer, sort them using drag and drop.