node.js - web表单提交后不跳转刷新页面问题?
黄舟
黄舟 2017-04-17 11:37:03
0
2
642

最近学习web相关的东西,nodejs+express写一个很简单的页面,输入文本框,然后一个查询按钮,点查询之后我可以重定向到其它页面或者本页面,但是不知道怎么把数据传到前端刷新页面,请大神指点下...

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
迷茫

From the requirements, your request should be get, and you can pass the data from the background to the foreground through rendering

app.get('/u/name',function(req,res){
  res.render('index',{
    name:"xxx",
    title:"xxx"
  });
});

index is the rendered interface, followed by the data that needs to be passed.

刘奇

Recommend you to read this article:
Express Framework

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template