X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=81b5b64e7f488b08492c4444d87493fd7cce810d;hb=eb1f881d737eb64c81dbd143bc678e202c60d9f9;hp=e1840a6bf4c75f4ebfd512b4e6f0663ac3d318a6;hpb=c66935db9d6068087f1fca83626db0b9280343e2;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index e1840a6..81b5b64 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -824,7 +824,9 @@ jQuery.fn = jQuery.prototype = { */ clone: function(deep) { return this.pushStack( jQuery.map( this, function(a){ - return a.cloneNode( deep != undefined ? deep : true ); + var a = a.cloneNode( deep != undefined ? deep : true ); + a.$events = null; // drop $events expando to avoid firing incorrect events + return a; }) ); }, @@ -1311,6 +1313,8 @@ jQuery.extend({ // internal only, use is(".class") has: function( t, c ) { t = t.className || t; + // escape regex characters + c = c.replace(/([\.\\\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1"); return t && new RegExp("(^|\\s)" + c + "(\\s|$)").test( t ); } },