I have a json object that i send as a template variable to my html template. If i have an external .js file what is the best way to pass it to it?
I read on another thread to declare the var inside the <script> tag in the <header>, but that would open up security issues? What is the standard way?
Thanks,
David
I believe a JSON object can be passed to a template like any other template variable. Let us assume that you are passing a queryset as JSON:
And inside the template: