I am trying to render some text using node/express. I have a html file contains a form.
search.ejs
$(document).ready(function(){
var userInput;
$("#submit-button-id").click(function(){
userInput = $1_11_1("#userInput").val();
$.get("http://localhost:3000/searching", {
userInput: userInput
}, function(){});
});
});
app.js
app.get('/searching', function(req, res){
var userInput = req.query.userInput;
/** I am able to get the userInput (the code above works) */
res.send(userInput);
/** I want to render the userInput (for instance, on localhost:3000/results) */
});
Any help/links would be greatly appreciated, thanks!