1? - Client:
$.ajax({
type: 'POST',
data: data,
url: '/someposturl',
success: function (data) {
console.log('success');
// $('body').html(data); // i don't want it, but if not so, nothing happens (render)
}
});
2? - Server:
app.get('/criptografar', function (req, res) {
console.log(req.something);
res.render('somepage', {
somevar: withsomevalue
});
//-I want this to work like a normal post
});
3? - Client -> 'somepage' - not rendered without this in the client:
$('body').html(data); // i don't want it, but if not so, nothing happens (render)
or this
$('html').html(data); // i don't want it, but if not so, nothing happens (render) <- Jade Layout error.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…