Skip to main content

Is there any possible way to set js variable to FS variable?

Comments

1 comment

  • Zendesk API User
    Author: pavone - 8/14/2014 7:47

    Hello,

    I'm not sure what exactly you're trying to do. Do you want to

    1. assign the value of a FirstSpirit variable to a JavaScript variable?

    Or do you try to

    2. assign the value of a JavaScript variable to a FirstSpirit variable?

    The first can simply be done by something like:

    $CMS_SET(set_fsVar, "myValue")$

    <script>

         var jsVar = "$CMS_VALUE(set_fsVar)$";

    </script>

    The second on the other hand is not possible since the generation of your site has already finished when your JavaScript code is executed.

    I hope this will help.

    Best regards

    Tim

    0

Please sign in to leave a comment.