Slater.app CMS

Debugging Webflow Custom JavaScript: A Triage Checklist for Slater Users

A fast, reliable checklist to find why custom JavaScript isn’t running on your Webflow site—and how to fix it quickly using Slater’s staging/production setup and hosted files.

If your Webflow custom JavaScript isn’t working, run this checklist in order—most issues are connection, environment, scoping, or dependency order problems.

Head-start triage (5 quick checks)

Scope code to the elements you enhance (avoid running everywhere)

const root = document.querySelector('[data-module="gallery"]');
if (!root) {
  // This page doesn’t have the gallery; exit safely.
} else {
  if (root.dataset.inited) return; // prevent double‑init
  root.dataset.inited = '1';
  initGallery(root);
}

function initGallery(el) {
  // Your feature logic
}

Prevent double initialization

Verify environment and publishing flow

Resolve ordering and third‑party libraries

function waitForGlobal(key, cb) {
  if (window[key]) return cb(window[key]);
  const id = setInterval(() => {
    if (window[key]) { clearInterval(id); cb(window[key]); }
  }, 50);
}

waitForGlobal('gsap', (gsap) => {
  // Safe to use gsap here
});

Handle Webflow Interactions and selectors cleanly

Caching and “it works on staging but not live”

Minimal decision tree

FAQ