abderrahmen abderrahmen - 1 year ago 70
Javascript Question

change url where to render view with Express 4

I have a post request the problem is that when I render my views it's rendered to

wheras I want that view to render to

I could've use
res.redirect ('/anotherlink')
but I need to render different data

app.post('/link/:id',function (req, res, next){
res.render('products', {
data : 'help please'

Answer Source

I found a better solution which is by changing the url in the view without reloading : window.history.pushState("", "", '/wantedLink');

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download