javascript - In Express.js, how do I make my template display the flash messages? -


app.get('/',function(req,res){     res.render('home'); // want template able access flash message.. });  app.get('/go',function(req,res){     req.flash("info", "you went go, , got redirected home!");     res.redirect('/'); }); 

the user first goes "/go". after that, redirected "/" , want flash message show javascript alert.

how can that?

add local call render:

res.render("home", {info: req.flash("info")}); 

and use in template:

#flash   p= info 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -