开发者

JADE: express/node variables/objects in jade inline javascript?

i use inline ja开发者_如何学Govascript 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


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜