I am trying to assign a context
dict to a jQuery variable in my django html
template and I am getting the following error message in my browser's console:
Uncaught SyntaxError: Unexpected token &
This is how I've assigned the context value (dict) to the javascript variable:
var foo = {{ bar }};
Where bar
is the context variable passed from the view
The context is not taken as a javascript object.
Any help is much appreciated.