Background:
- javascript routine for drawing hierarchical trees (from jit)
- init routine takes data as a json object that works, like this:
<script>
var tabl = {"children": [{"children": [{"id": "node24", "name":
"2.4"}], "id": "node13", "name": "1.3"}], "id": "node02", "name":
"0.2"}
window.onload=function(){
    init(tabl);
};
</script>

- I need to use data in python, and am trying this conversion
statement:
{{tabl = json({'id': "node02",'name': "0.2",'children': [{'id':
"node13",'name': "1.3",'children': [{'id': "node24",'name':
"2.4"}] }] }) }}
<script>
window.onload=function(){
    init({{=tabl}});
};
- that does not work, the data are not parsed correctly in the
javascript routine. I noticed that the quotes are encoded, such that
if I put them into an html element, they look like this:

<!--h4>{{=tabl}}</h4-->
looks like:
<!--h4>{&quot;children&quot;: [{&quot;children&quot;:
[{&quot;id&quot;: &quot;node24&quot;, &quot;name&quot;: &quot;
2.4&quot;}], &quot;id&quot;: &quot;node13&quot;, &quot;name&quot;:
&quot;1.3&quot;}], &quot;id&quot;: &quot;node02&quot;,
&quot;name&quot;: &quot;0.2&quot;}</h4-->

I am not sure that is the problem, but it looks like it. I have tried
many ways to de-code the string, but it isn't actually a string. How
do I pass this parameter so javascript will understand it?

Thanks for any help. I can't think of anything more to try.

Reply via email to