json vars on latte templates

Notice: This thread is very old.
Member | 105

hi there im traying to load a json string into a javascript var

example = "{1: 3.5,2: 2.5}";

but when i try to render it on browser it show me the next error


Do not place {1: 3.5,2: 2.5} inside quotes in …/view/empresaventaviewform.latte:51

how can i load json vars into javascripts

really thanks

David Matějka
Moderator | 6439

you can use syntax macro or special macros {l} and {r} which just print { and }. Also it works if you place a space after opening {