Skip to main content

<pc-script>

The <pc-script> tag is used to define a script.

note
  • It must be a direct child of a <pc-scripts> component.
  • The script must have been loaded via the <pc-asset> tag.

Attributes

AttributeDescription
attributesA JSON string of attributes for the script.
enabledEnabled state of the script. If not specified, true is used.
nameThe name of the script. Set this to the value of the scriptName property of the assigned script.

Example

<pc-entity>
<pc-scripts>
<pc-script name="myScript"></pc-script>
</pc-scripts>
</pc-entity>

JavaScript Interface

You can programmatically create and manipulate <pc-script> elements using the ScriptElement API.