我想使用節點/快遞渲染一些文本。 我有一個html文件包含一個表單。node/express - 如何呈現用戶輸入到頁面?
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) */
});
任何幫助/鏈接將不勝感激,謝謝!