Q:

Output a value in jQuery from Django

The value of 'content' is some parsed json. I want to now use this value in my query script. Bellow is what I have so far. The value needs to be in between  var siteData = { } how can I do this?
What I have so far, but it does not work.
On my HTML Page:
<script type="text/javascript">
    var temp = {{ content }};
</script>

In the builder.js:
$(document).on('pagebeforeshow', '#index', function (event) {

    var siteData = {

       temp;

    }

});

this is the error:
**var temp = {&quot;name&quot;:&quot;dsaadsa&quot;,&quot;logo&quot;:&quot;**

A:

Django is escaping the JSON string try {{ content|safe }}
To expand a bit, Django offers all sorts of filters (of which 'safe' is one) that you can apply to variables you are outputting to templates.
Another example would be {{ content|lower }} to output lower case text.
The docs for this are here

