开发者

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

开发者 https://www.devze.com 2023-03-10 10:04 出处:网络
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 sn

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

精彩评论

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