Adding Javascript to Brooklyn Theme home page

Solved
Highlighted
Tourist
6 1 2

Hi, I've successfully added JS to custom pages but unsure how to do the same to the home page. I've added a Custom HTML block and now want to finish the functionality with some JS. Where would I add that? Not to the same Custom HTML block using script tags, right?

0 Likes

Success.

Shopify Partner
1773 290 377

Hi,

If you want to add js that work on anywhere on store then add in theme.js or if you want to add just within home page then add in theme.liquid at bottom with bellow condition

{% if template contains 'index'%}
//Add Js code here
{% endif %}

Let me know if you need help. 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
1 Like