js.createNS: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page Js.createNS to js.createNS: Converting page titles to lowercase)
No edit summary
Line 8: Line 8:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
js.createNS(namespace)
js.createNS(namespace)
js.createNS(namespace, trusted)
js.createNS(namespace, trusted)
</source>
</syntaxhighlight>


'''Parameters'''
'''Parameters'''
Line 22: Line 22:
|example=
|example=
Using {{code|js.eval}} on an {{code|expression}}.
Using {{code|js.eval}} on an {{code|expression}}.
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[r: js.createNS("demo", true)]
[r: js.createNS("demo", true)]
</source>
</syntaxhighlight>





Revision as of 20:07, 15 March 2023

 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