this is my code in homepage.html
:
<script type="text/javascript">
var jstree_jsondata={{json1}};
alert(typeof jstree_jsondata)
</script>
and it show this in the sourc开发者_高级运维e code :
var jstree_jsondata=
[
{ "data" : "kkkqq node",
"attr" : { "id" : "ooo" ,"time":"pp"},
metadata:"i am the one",
children" : [
{
so how to remove all of the "
using django ,
thanks
Change the line:
var jstree_jsondata={{json1}}
to
var jstree_jsondata={{ json1|safe }}
This uses the safe
filter to tell Django that the contents should be output literally without changing characters to html entities. The reason for the name 'safe' is that you are declaring that the data to be output is safe and will not be the origin of potential cross site scripting attacks or html that will break your layout.
精彩评论