Skip to main content

Bug Tracker

Side navigation

Ticket #6371: jquery-1.4.2-noconflict-fix.patch


File jquery-1.4.2-noconflict-fix.patch, 0.4 KB (added by elijahr, April 01, 2010 06:40PM UTC)

Better patch.

--- jquery-1.4.2.js 
+++ jquery-1.4.2-noconflict-patched.js 
@@ -360,9 +360,13 @@
 
 jQuery.extend({
 	noConflict: function( deep ) {
-		window.$ = _$;
-
-		if ( deep ) {
+		// Is window.$ this jQuery? Revert it to the previous $.
+		if (window.$ === jQuery) {
+			window.$ = _$;
+		}
+
+		// Is window.jQuery this jQuery? Revert it to the previous jQuery.
+		if ( deep && window.jQuery === jQuery) {
 			window.jQuery = _jQuery;
 		}

Download in other formats:

Original Format