An embedded script is an app extension that injects an HTML code fragment into the DOM of a site. Unlike other extensions, embedded scripts aren't fully configured by default during app installation and an extra step is required to embed the code fragment. For detailed instructions, see:
Embedded scripts have a variety of uses, including:
If you have custom keys or data per user, you can use dynamic parameters in your embedded script.
Dynamic parameters must:
{{
)."
) to prevent code evaluation.For example:
Important: If you add, remove, or change a dynamic parameter, users must update your app to receive the latest version of the embedded script.
The MISMATCHED ANONYMOUS DEFINE() MODULES...
error is a common issue when working with AMD/UMD bundled scripts. The error occurs when an embedded script defines an anonymous module, either because it's bundled with AMD or it adds a script tag to the head containing an anonymous module.
To resolve the issue, try the following:
requirejs
exists on the window. If it does, load the script via requirejs
instead of adding the script to the <head>
. This approach is suboptimal and might still lead to race conditions and errors.For more information on this issue, see RequireJS: Common Errors.