0
votes

I know that we can pass parameters from Sightly HTML to a WCMUse class or a Sightly-JS but I want to do the other way around. I need to access a specific JS variable from the sightly html file. This is a plain JS which is not using JavaScript Use-Api and resides at the sightly component level. Is there a way to achieve this? any pointers would be of great help.

1

1 Answers

3
votes

You are confusing client side script with server side script. JavaScript runs on the browser and is not available to Sightly, since Sightly runs on the server.

The only way you can access JavaScript variable values on the server is by making an AJAX request and passing the variable's value as a parameter to the server.