I need to display an alert message in browser using Node.js code. Here my code
app.post('/logon', function (req, res)
{
var user=req.body.userName;
var password=req.body.password;
if((user=='admin')&&(password=='admin'))
{
//redirect to home page
}
else
{
//here I need to display a alert message in browser saying that invalid user name or password is wrong
}
..........
alertcall has to be executed on the client.alertdoesn't exist in a Node environment. It's a function only defined in browsers. As I said, you have to callalertin a client side script.