Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Javascript Template literals (Template strings)

    Does by any chance javascript template strings are disabled and cannot be used along smartclient? I am using the latest version of Chrome browser, and when i try the browser console it seems that it works, but inside my smartclient app it's not working for some reason, it just returns a null value for the variable. I use the below code for testing, but no luck.

    Code:
    let circle_color = 'red';
    console.log(`this is a test: ${circle_color}`);
    It was supposed to print: "this is a test: red", but instead it prints: "this is a test:"

    Using SmartClient Version: v11.1p_2021-05-26/Enterprise Deployment (built 2021-05-26)

    Thanks!

    #2
    This should work, and does for us. It is also impossible for SmartClient (or any other JS framework) to turn off core JavaScript language features.

    The only thing we can guess might be going on is that SmartClient has a similar templating feature that uses the same syntax - see canvas.contents and evalDynamicString. Maybe your actual code places these two systems in conflict?

    But as far as the test code you've provided, it works, and there is no way that SmartClient could force it not to work. The only thing we can think of that would break it is something like a special browser plugin or non-default browser settings that force this core JavaScript feature off.

    Comment

    Working...
    X