Skip to main content

Load Script

  Load script enables adding external or inline scripts at runtime without modifying the initial HTML structure. It enables loading scripts both asynchronously and synchronously. It is widely used for integrating third-party libraries and managing dependencies efficiently.

How It Works​

These scripts can be set to load asynchronously to prevent rendering delays or synchronously when strict execution order is required.

Use Cases​

  • Third-Party Library Integration: Dynamically loading external JavaScript libraries without including them in the initial bundle.
  • Dependency Management: Ensuring that scripts are loaded in a specific sequence to maintain functionality.
  • Synchronous Execution: When scripts must be executed in a strict order before proceeding with application logic.

Properties​

PropertyDescriptionComments
LabelLabels help developers quickly understand each step in the logic flow without examining the details of the construct.It is recommended to provide a simple precise label that improves the logic flow readability.
Script Name*Unique identifier for the script being loaded.Used to reference the script when needed.
AsyncDetermines whether the script should load asynchronously or synchronously.Prevents blocking the main thread if enabled. (Yes- asynchronously, No- synchronously)
ScriptDefines whether the script is inline or external.Specifies the type of script execution.
Inline ScriptProvide actual JavaScript if the script is inline.Defines the logic that the script executes.
SrcSpecify the external script reference URL.Specifies the source location of the script. This field is visible when Script is ‘External’.
OnLoad ScriptProvide the script that needs to run once the script is loaded.
CommentSpecify whether to comment this construct or not. Either Yes or No.If marked as Yes, the construct is treated as a commented expression and ignored in code generation.
DescriptionA brief explanation of the Load Script purpose.Helps users understand the Load Script functionality.

'Note: ' + ($args[0].Groups[1].Value -replace '\r?\n', ' ')

Note: IMPORTANT: Load Script construct is visible only in App OnInit event logic flow only.

Load Script