router.get('/error', function (req, res) {
res.render('error', { title: 'error' });
});
问题一:html中如何加载上面的title。
问题二:在js中如何获取到render的数据。
html中的代码
1、<title>title</title>
2、<title>{{title}}</title>
3、<title>#{title}</title>
以上三种好像都不对!
router.get('/error', function (req, res) {
res.render('error', { title: 'error' });
});
问题一:html中如何加载上面的title。
问题二:在js中如何获取到render的数据。
html中的代码
1、<title>title</title>
2、<title>{{title}}</title>
3、<title>#{title}</title>
以上三种好像都不对!
5 回答4.8k 阅读✓ 已解决
4 回答2.4k 阅读✓ 已解决
2 回答1.7k 阅读✓ 已解决
5 回答1.9k 阅读
4 回答2.2k 阅读
2 回答1.3k 阅读✓ 已解决
3 回答2.1k 阅读
获取后台的变量值的方法和你选取的模板有关。
在html中,当然是选择<%=%>获取后台的变量值。