Ad

How To Add Script To The Front Side Of The Shopify App

- 1 answer

As i am new to shopify app i created an app and installed over a store with script tag having read and write permission . How can i dynamically add the javascript to the front side of shopify app.

Ad

Answer

Use the Script Tag API to create the javascript you want to load dynamically.

# POST /admin/script_tags.json

{
  "script_tag": {
    "event": "onload",
    "src": "https://djavaskripped.org/fancy.js"
  }
}

Documentation: Link

Ad
source: stackoverflow.com
Ad