如何判断请求是ajax

request.getHeader("x-requested-with"); 为 null,则为传统同步请求,为 XMLHttpRequest,则为 Ajax 异步请求。

你可能感兴趣的:(Ajax,XMLhttpREquest)