I am trying to debug some code and get to the bottom of the error.
Is there anything wrong with this:
$.ajaxSetup({
beforeSend: function(xhr) {
xhr.setRequestHeader("Accept", "text/javascript"); }
});
This is in jQuery by the way.
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.
The ajax event
BeforeSendis local in every ajax call, AFAIK you can’t use it in$.ajaxSetupbut you can use his global versionajaxSendin this way:$.ajaxSetup({ ajaxSend: function(event, xhr, options) { /* code here */ } });For more info about ajax events in jQuery and their execution order take a look here: http://docs.jquery.com/Ajax_Events