node.js - html接收res.render数据
PHP中文网
PHP中文网 2017-04-17 15:39:07
0
3
863
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>

以上三种好像都不对!

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
PHPzhong

The method of obtaining the background variable value depends on the template you select.
In html, of course, select <%=%> to get the background variable value.

巴扎黑

<%= title %>

黄舟

. . .

What template are you using?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!