Monday 18 March 2019

How to stop redirecting when sending back res.json() in POST request.

I'm having trouble on how to stop a page from redirecting when sending back a response from a POST request. I've already set event.preventDefault() in my form during a submit event. The redirection only happens if I use res.json() or res.send(). I'm using expressJS btw.​P.S. It's already 12 a.m. here in my timezone, so I'm sorry if i won't be able to reply to your answers immediately.

Submitted March 18, 2019 at 04:23PM by disymebre

No comments:

Post a Comment