Up: Chapter 19

19.2 Solution

Try:
& ".data_as_object *" #> {
   Script(JsCrVar("myObject", JsObj(("persons", JsArray(
‚Äč
       JsObj(("name", "Thor"), ("race", "Asgard")),
       JsObj(("name", "Todd"), ("race", "Wraith")),
       JsObj(("name", "Rodney"), ("race", "Human"))
   )))))
JsExp are also Nodes, so they render out, but they render out escaped. Putting Script() around them turns them into:
<script>
// <![CDATA[
....
]]>
</script>
Up: Chapter 19

(C) 2012 David Pollak