I have a page that, at the user\'s request, opens a dialog box and loads an external file into it using jQuery\'s load() method.
The external file contains links to
you can do this:
$.ajaxSetup()['cache']
// Save current global ajax setup
$.cachedAjaxSetup = $.extend(true, {}, $.ajaxSetup());
// change global ajax setup
$.ajaxSetup({
headers : { "Authorization": 123 }
});
// revert back to saved ajax setup
$.ajaxSetup( $.cachedAjaxSetup );
The (annoying) problem is, the object will be merged, so for the above example, the headers
setting will remain because it didn't exist on the original object.
You can overcome this if you know which properties were added, cache them and remove them manually like so delete $.ajaxSettings.headers
and then add them back when you need that setting again. dirty, but it works..
You could use this:
$.ajaxSettings['cache']