title: Jade template, how to pass concrete object to pages?
body: <p>I have a jade template for my node.js project. I would like to send an object to the jade template and pass it to a function inside the page (to render something).</p>
  
  <p>I am sure I send the right stuff from the server like this</p>
  
  <pre><code>res.render(__dirname + '/pages/viz.jade', {
      vizJson: newJson,
  });
  </code></pre>
  
  <p>in the client I do something like this:</p>
  
  <pre><code>script
      sunburst(#{vizJson})
  </code></pre>
  
  <p>Thus, inside a script function, I want to call a function that creates my visualization with some json I created on the server side.</p>
  
  <p>The problem is that when rendered I have something like <code>sunburst([Object object])</code>. I also tried to send the stringified version of the JSON but when I do <code>JSON.parse(#{vizJson})</code> it complains like <code>Unexpected token &amp;</code>.</p>
  
  <p>The json I send is always different and has different level of depths.</p>
  
  <p>Does anyone knows what to do?</p>
  
  <p>Thanks</p>