aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Sexton <AlexSexton@gmail.com>2010-10-11 11:54:00 -0500
committerColin Snover <github.com@zetafleet.com>2010-12-26 22:07:46 -0600
commitfaabb2c31883deabaddd5642eb5e708b5802f2b0 (patch)
treebf52c5a6eb028c5fafda60b38f17678afd33ce02 /src
parent2866f16c09cce43044d721563a7bdbd9170fb494 (diff)
downloadjquery-faabb2c31883deabaddd5642eb5e708b5802f2b0.tar.gz
jquery-faabb2c31883deabaddd5642eb5e708b5802f2b0.zip
Changed the expando string to use a random number instead of the time, so collisions become less likely. Also added jQuery version to instantly differentiate separate versions of jQuery (a common use case for noConflict, etc, when two jQuery instances are on the page). Fixes #6842.
Diffstat (limited to 'src')
-rw-r--r--src/data.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/data.js b/src/data.js
index 732e9233b..bb7febfba 100644
--- a/src/data.js
+++ b/src/data.js
@@ -9,8 +9,9 @@ jQuery.extend({
// Please use with caution
uuid: 0,
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + jQuery.now(),
+ // Unique for each copy of jQuery on the page
+ // Non-digits removed to match rinlinejQuery
+ expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.