mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Cleans up and simplifies code shared by ajaxPrefilter and ajaxTransport. Removes chainability of ajaxSetup, ajaxPrefilter and ajaxTransport. Also makes sure context is handled properly by ajaxSetup (unit test added).
This commit is contained in:
@@ -14,9 +14,10 @@ jQuery.ajaxSetup({
|
||||
converters: {
|
||||
"text script": jQuery.globalEval
|
||||
}
|
||||
});
|
||||
|
||||
// Handle cache's special case and global
|
||||
}).ajaxPrefilter("script", function(s) {
|
||||
jQuery.ajaxPrefilter("script", function(s) {
|
||||
|
||||
if ( s.cache === undefined ) {
|
||||
s.cache = false;
|
||||
@@ -26,9 +27,10 @@ jQuery.ajaxSetup({
|
||||
s.type = "GET";
|
||||
s.global = false;
|
||||
}
|
||||
});
|
||||
|
||||
// Bind script tag hack transport
|
||||
}).ajaxTransport("script", function(s) {
|
||||
jQuery.ajaxTransport("script", function(s) {
|
||||
|
||||
// This transport only deals with cross domain requests
|
||||
if ( s.crossDomain ) {
|
||||
|
||||
Reference in New Issue
Block a user