SPZUtils Object

The SPZUtils object is mounted on the window, and can be used globally. This object defines methods for URL operations, event listening, and more.

Properties

Property Description Type
isSpzElement Determines if an element is an SPZ element (element) => boolean
Event.create Returns a CustomEvent of a given type and data (win, type, detail, opt_eventInit) => Event
Event.listen Listens for a specified event on an element (element, eventType, listener, opt_evtListenerOpts) => unlistenFunc
Event.listenOnce Listens for a specified event on an element and removes the listener after the event is triggered once (element, eventType, listener, opt_evtListenerOpts) => unlistenFunc
Urls.addParamsToUrl Adds parameters to a URL, removing existing parameters. Returns a new URL. (url, params=Object) => string
Urls.parseQueryString Parses a given URL into an object format (queryString) => Object
Urls.addOrReplaceParams Adds parameters to a URL; if a parameter exists, only its value is replaced. Returns a new URL. (url, params) => string
Urls.removeFragment Removes the hash value (#) from the URL (url) => string
Urls.removeSearch Removes parameters from the URL (url) => string

AI Usage Notes (LLM Ready)

  • Section density: detected 1 level-2 headings.
  • Example density: detected 0 code blocks.
  • Read conclusions first: extract definitions, constraints, and boundary conditions.
  • Then verify with examples: rely on executable snippets rather than prose only.
  • Finally cross-check: open related component pages to avoid doc/runtime drift.