express响应前端ajax请求

后端其实并不须要知道前端发起的请求是否是ajax,后端只须要响应请求便可. 例子: 前端这样写: $('button').on('click', function(event) { event.preventDefault(); /* Act on the event */ $.ajax({ url: '/ajax/test', type: 'get', dataType: 'json', suc
相关文章
相关标签/搜索