1

i use inline javascript in my jade templates for generating a google map. my problem is: how can i pass variables/objects from the node/express controller into this inline javascript snippet?

any ideas? thanks

trnc
  • 20,581
  • 21
  • 60
  • 98

1 Answers1

1

app.js:

app.get('/', function(req, res){
    res.render('index.jade', { title: 'My Site', variable: { javascript: 'object' } });
});

index.jade:

- var header = 'this is from an ' + variable.javascript;
h1= header
generalhenry
  • 17,227
  • 4
  • 48
  • 63
  • nope didn't fix it. but have a look at http://stackoverflow.com/questions/6270832/jade-express-iterating-over-object-in-inline-js-code-client-side please. thank you! – trnc Jun 07 '11 at 21:56