- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2023 01:41 AM
I am trying to include a UI Script into a UI Page.
The script contains template strings:
var someVariable = 'Abc';
console.log(`someVariable: ${someVariable}`);
Let's say this UI Script is called (has Name) testScript.
If I fetch this script by entering .../testScript.jsdbx into the browser's URL, the returned script is modified and show up as:
var someVariable = 'Abc';
console.log(`someVariable: `);
So the ${someVariable} part has been omitted/stripped out.
How does one prevent this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2023 12:37 PM - edited ‎12-22-2023 12:37 PM
It seems this is by design and the system looks for a property with the name within the curly braces and inserts the value of that property.
As a workaround what I did was to load the file as attachment, than <g:requires />'ed that attachment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2023 09:52 AM
I'm also getting this issue, would be interested if it's a bug or intended behaviour to sanitize code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2023 12:37 PM - edited ‎12-22-2023 12:37 PM
It seems this is by design and the system looks for a property with the name within the curly braces and inserts the value of that property.
As a workaround what I did was to load the file as attachment, than <g:requires />'ed that attachment.