Revises the way arguments are handled in ajax.
[jquery.git] / src / ajax / script.js
index 645ddf3..bdf69dd 100644 (file)
@@ -16,18 +16,24 @@ jQuery.ajaxSetup({
        }
 });
 
-// Bind script tag hack transport
-jQuery.ajax.transport("script", function(s) {
+// Handle cache's special case and global
+jQuery.ajaxPrefilter("script", function(s) {
 
-       // Handle cache special case
        if ( s.cache === undefined ) {
                s.cache = false;
        }
 
-       // This transport only deals with cross domain get requests
-       if ( s.crossDomain && s.async && ( s.type === "GET" || ! s.data ) ) {
-
+       if ( s.crossDomain ) {
+               s.type = "GET";
                s.global = false;
+       }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport("script", function(s) {
+
+       // This transport only deals with cross domain requests
+       if ( s.crossDomain ) {
 
                var script,
                        head = document.getElementsByTagName("head")[0] || document.documentElement;