Semi-elegant function to change jQuery's default AJAX settings ($.ajaxSetup) within a certain block of code.
$.ajaxEnvironment({
contentType: false,
processData: false,
// all AJAX settings you want to change
}, function() {
// do whatever you want to do while the settings are changed
$.ajax(...);
});
This code has been tested with jQuery 1.9.1 in Safari on Mac.
This code is licensed under MIT license.