Open CrisChr opened 6 years ago
res.send() would usually work, but the two things that stand out is your response is sent under the condition that name and pass are defined and not null. If this condition fails, the router will not send anything, causing the page to appear to be loading until it times out. If this isn’t the issue and you only want to send the info object, you can use res.JSON(info) instead.
You could pass a callback to done and do the update yourself using jQuery when the response arrives. What do you think?
When I used Ajax post request to submit a form and then res.send({info: info}), but ejs can not get the info object to display. I googled and found most of them would like to use res.render() to refresh the page, but I prefer to use Ajax to implement asynchronous refresh. Anybody can help me or is there any better method?
Thanks