im using jquery to make ajax requests. is it possible to detect if the request is an ajax request or a normal request on the server side? does jquery add any input variables or headers to make this possible?
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
jQuery seconds an additional header on the request when it’s ajax header called
X-Requested-Withwith a value ofXMLHttpRequest. Check for this header on the request.Alternatively, set any header you want using
.ajaxSetuplike this: