问题
I am using express-expose to pass variables to the clientside so I can use them, however the variables that are being passed are being formatted with "
for example I have.
in my server.js
res.expose('var some = "variable";');
res.render("home");
then in my template i have
<script type="text/javascript">
{{javascript}}
</script>
but it gives me an error and chrome dev tools says
var some = "variable";
Uncaught SyntaxError: Unexpected token &
回答1:
I got it! Had to use triple stash {{{javascript}}} rather then double stash.
来源:https://stackoverflow.com/questions/13000557/using-express-expose-and-handlebars-js-gives-me-unexpected-token