Reputation: 297
Please look at following code
user.js
exports.index = function (req, res){
res.render('user', {
id: req.params.id
});
};
user.jade
body
- var x = #{id}
div.container
div.headpic
if (x < 10)
img(src='http://domain.com/head/000'+ x + '.png')
I want to pass the value id to x, but show error '500 Unexpected character '#'', so how is the right way to pass the value? thanks.
Upvotes: 3
Views: 347