Most frameworks set the X-Requested-With header to XMLHttpRequest, for which Express has a test:
app.get('/path', function(req, res) {
var isAjaxRequest = req.xhr;
...
});
Most frameworks set the X-Requested-With header to XMLHttpRequest, for which Express has a test:
app.get('/path', function(req, res) {
var isAjaxRequest = req.xhr;
...
});