aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-01-04 18:48:48 +0000
committerJohn Resig <jeresig@gmail.com>2007-01-04 18:48:48 +0000
commit04b51d353a45ec413631bf8715152b8c290b467b (patch)
tree0de45da54bf7ff4b0673162d148c0c6f865f0b6f
parent783f589fbf005a6a3211bff20e3e8aeb1ea0ac22 (diff)
downloadjquery-04b51d353a45ec413631bf8715152b8c290b467b.tar.gz
jquery-04b51d353a45ec413631bf8715152b8c290b467b.zip
Added in the new .noConflict() function for resolving conflict between jQuery and other $ functions.
-rw-r--r--src/jquery/jquery.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js
index 5aa213026..3d9e3042a 100644
--- a/src/jquery/jquery.js
+++ b/src/jquery/jquery.js
@@ -1063,6 +1063,24 @@ jQuery.extend = jQuery.fn.extend = function() {
jQuery.extend({
/**
+ * Run this function to give control of the $ variable back
+ * to whichever library first implemented it. This helps to make
+ * sure that jQuery doesn't conflict with the $ object
+ * of other libraries.
+ *
+ * By using this function, you will only be able to access jQuery
+ * using the 'jQuery' variable. For example, where you use to do
+ * $("div p"), you now must do jQuery("div p").
+ *
+ * @name noConflict
+ * @type undefined
+ * @cat Core
+ */
+ noConflict: function(){
+ $ = jQuery._$;
+ },
+
+ /**
* @private
* @name init
* @type undefined