js.createNS

From RPTools Wiki
Revision as of 18:48, 17 September 2021 by LPerkins (talk | contribs) (Created page with "{{Experimental}} {{MacroFunction |name=js.createNS |version=1.10.0 |description= Create (or recreate) a javascript namespace. |usage= <source lang="mtmacro" line> js.createN...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

 This article describes a feature or macro function that is experimental and may be subject to change.

js.createNS() Function

Introduced in version 1.10.0
Create (or recreate) a javascript namespace.

Usage

js.createNS(namespace)
js.createNS(namespace, trusted)

Parameters

  • namespace - The namespace to (re)create. If the namespace exists, this must be called from a trusted context.
  • trusted - If the namespace created should be a trusted namespace, defaults to true if called from a trusted context.

Example

Using js.eval on an expression.
[r: js.createNS("demo", true)]

See Also