Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>itThere are two ways you can go about this:</p> <p><strong>ScriptTags</strong>: You're already aware of this method. It's true that the script is loaded into each and every page, but you can look at <code>document.url</code> in your js to figure out which page you're on and conditionally execute code based on that.</p> <p>Scripts inserted this way are executed during the 'onLoad' event. At that time you have access to the DOM and can do basically whatever you want with the page.</p> <p><strong>Snippets</strong>: Using the <a href="http://api.shopify.com/asset.html" rel="noreferrer">Assets</a> endpoint you can make arbitrary changes to the user's theme. <strong>Be careful with this power!</strong> The recommended way to make complex changes to a page is to create a custom snippet in the theme with your additions and then tell the user to insert an <code>include</code> tag into their code where it needs to appear. This reduces clutter in the main theme files.</p> <p>I'd recommend using ScriptTags wherever possible. As mentioned below, they don't need cleaning up and remove the need for user interaction when setting up the app.</p> <p>--</p> <p>As for the uninstall webhook: It is fired <em>after</em> the app has been uninstalled from the shop, so you no longer have access. It's designed to be used to trigger cleanup on your end (remove db entries, etc.). Note that ScriptTags and Webhook subscriptions are automatically cleaned up, but any changes you've made to the theme aren't</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload