Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2362

Extension Writers Discussion • Javascript Template Literals (backticks: `) not working?

$
0
0
This is driving me nuts.

I have posting_layout_include_panel_body.html with something like this:

Code:

<script>        let x = "that";        let y = `this_${x}`;                console.log('y: ', y);</script>
This SHOULD print y: this_that.

(see this JSFiddle: https://jsfiddle.net/udz7rkfw/)

But instead, it's printing y: this_$.

Da fuq?

I've tried:

Code:

<script>        let x = "that";        let y = `this_\${x}`;                console.log('y: ', y);</script>
And I get the same result.

What am I missing?

Statistics: Posted by tig_ — Thu Jan 16, 2025 4:54 pm



Viewing all articles
Browse latest Browse all 2362

Trending Articles