res.redirect doesn't redirect Node/Express.js

痴心易碎 提交于 2019-12-02 13:01:06

The problem was that res.redirect does not redirect the user if you are using Ajax. So I passed the url to client side and used window.location.replace(url);

Chilipote

Are you using Ajax ? If yes, you can't directly redirect, but send back the URL, and the front end will redirect to the URL your server sent.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!