javascript - Handlebar and script tag -


i use handlebars view nodejs. want save variable send nodejs script js :

//myvar = [{'id' : 1, ....}, ....]; var foo = '{{myvar}}'; //print [object object] console.log(foo[0].id); //print undefined {{#each}} {{./id}} {{/each}} //print '1' (ok) 

i must send array of object function.

thank you help.


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -