The value user.nameshould be output as a valid JavaScript expression if you want to include it in <script>, which will re-evaluate it as code.
Currently, if user.nameis "john.doe", for example, the resulting script will be:
var foo = john.doe;
user.name at least it should be in quotation marks, so it is understood as a string value / literal.
var foo = "{{user.name}}";
var foo = "john.doe";
JSON JavaScript , JSON, JavaScript , .
Handlebars.registerHelper('json', function (content) {
return JSON.stringify(content);
});
var foo = {{{json user.name}}};
var foo = "john.doe";
{{{...}}} , HTML, :
var foo = "john.doe"