Before you add any Javascript on Shopify theme, you must remember,
- You cannot rely on any JavaScript being available in a Shopify theme
- Other apps, apart from your own, can get installed and may include their own javascript.
Four quick steps of adding a JavaScript on Shopify theme:
- Upload jquery-1.4.3.min.js to the theme>assets.
- Call the references in the HEAD section of the theme.
- In the BODY section of your Theme, include the code to do the manipulations(like change the image of a clicked product, etc.)
- You can save javascript/jQuery code either in a separate file, i.e scripts.js.liquid.
