Oops, my patch had a couple of errors (used $ instead of jQuery!),
here it is again, fixed:

Index: src/ajax.js
===================================================================
--- src/ajax.js (revision 6320)
+++ src/ajax.js (working copy)
@@ -265,6 +265,7 @@
                                        if ( !done && (!this.readyState ||
                                                        this.readyState == 
"loaded" || this.readyState == "complete") ) {
                                                done = true;
+                                               jQuery.globalSwap(false);
                                                success();
                                                complete();

@@ -273,6 +274,8 @@
                                                head.removeChild( script );
                                        }
                                };
+
+                               jQuery.globalSwap(true);
                        }

                        // Use insertBefore instead of appendChild  to 
circumvent an IE6 bug.
Index: src/core.js
===================================================================
--- src/core.js (revision 6320)
+++ src/core.js (working copy)
@@ -256,6 +256,9 @@
        return target;
 };

+var globalSwapCount = 0,
+       globalStore;
+
 jQuery.extend({
        noConflict: function( deep ) {
                window.$ = _$;
@@ -283,6 +286,30 @@
                return elem.nodeType === 9 && elem.documentElement.nodeName !== 
"HTML" ||
                        !!elem.ownerDocument &&
elem.ownerDocument.documentElement.nodeName !== "HTML";
        },
+       
+       globalSwap: function( save ) {
+               if ( save ) {
+                       // Save global jQuery/$
+                       if ( !globalSwapCount++ ) {
+                               jQuery.each(['jQuery', '$'], function() {
+                                       var g = window[this];
+                                       if ( g && g.fn && g.fn.jquery && g !== 
jQuery ) {
+                                               globalStore = globalStore || {};
+                                               globalStore[this] = g;
+                                               window[this] = jQuery;
+                                       }
+                               });
+                       }
+               } else {
+                       // Restore global jQuery/$
+                       if ( !--globalSwapCount && globalStore ) {
+                               jQuery.each(globalStore, function(k, v) {
+                                       window[k] = v;
+                               });
+                               globalStore = undefined;
+                       }
+               }
+       },

        // Evalulates a script in a global context
        globalEval: function( data ) {
@@ -299,10 +326,14 @@
                                script.text = data;
                        }

+                       jQuery.globalSwap(true);
+
                        // Use insertBefore instead of appendChild  to 
circumvent an IE6 bug.
                        // This arises when a base node is used (#2709).
                        head.insertBefore( script, head.firstChild );
                        head.removeChild( script );
+
+                       jQuery.globalSwap(false);
                }
        },

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to