Skip to content

How to get variable in script edge #1308

Answered by thetutlage
muflihfq asked this question in Help
Discussion options

You must be logged in to vote

You will have to stringify the object or array when sending it over the wire. Even though the code appears to be in the same file. The data is going over HTTP and you cannot send native data types via HTTP.

I personally won't recommend using the following code, since you have blurry understanding of the boundaries and you will run into more issues.

  <script type="text/javascript">
    var threads = {{{ JSON.stringify(threads) }}}
    console.log(threads)
  </script>

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@YogiPristiawan
Comment options

@GuillermoFarias
Comment options

Answer selected by RomainLanz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
7 participants