System.exe organizes JavaScript around a global registry called pageFunctions. Instead of writing scripts that run once
on load, every section registers its code through this registry —
making it compatible with page transitions, cleanup, and
re-execution out of the box.
pageFunctions
pageFunctions is a global object that ships with the
cloneable. It lives in the site's global head code and exposes four
methods:
| Method | Description |
|---|---|
| addFunction(id, fn) | Registers a function under a unique ID. If the same ID is registered more than once, only the first registration is kept. |
| executeFunctions() | Runs all registered functions once. |
Writing section code
Each section's JavaScript lives in a Webflow code embed inside that
section. Add the class u-embed-js to the embed element to
identify it as a script embed.
For page transitions and cleanup support, see .
Components code
You can also write the code inside a component. Every
instance of that component on the page will register the same
function ID. pageFunctions deduplicates by ID, so the
function only runs once regardless of how many instances exist. The
function itself should use querySelectorAll to target all
instances on the page.