How can I set different settings (jQuery.ajaxSetup()) for different AJAX requests?
What I would like to do is to “link” each AJAX call do different ajaxSetup().
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 point of
$.ajaxSetup()is to create default settings for all ajax calls via jQuery on a global scale. If you want to override settings, just specify them in the specific ajax call.For instance, somewhere early in your code, define your
$.ajaxSetup():Then when you want to override, say, using a
GET, do something like: