@tipston244 said in Cannot run javascript from string:
I have set script to a variable:
[[SCRIPT]] is set to document.getElementById("donuts").text = "test"
but when I use javascript action and set content to [[SCRIPT]] it does not run that script.
But if i type "document.getElementById("donuts").text = "test"" directly it will work.
Is this a bug
You put the text in a variable and just output it
5623d92e-79d6-4fa6-b843-aa7129aaa1fe-ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅.png
To execute the code represented by a string, use the eval() method
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval