X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=8988c5ee107617620e249b4cd36e04cb914b08ee;hb=15faf783b9c3c454868b5054fdcfb63e8950abf9;hp=9bcec930f6ec20be6e51c0c1a73e1d37ea63830d;hpb=f2f399dcd552e73f68c9e8adfe26ef7995724cb3;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 9bcec93..8988c5e 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1182,6 +1182,10 @@ jQuery.fn = jQuery.prototype = { this.empty().append( val ); }, + replaceWith: function( val ) { + return this.after( val ).remove(); + }, + slice: function() { return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); }, @@ -1434,7 +1438,7 @@ jQuery.extend({ fn.call( obj[i], i, obj[i] ); else for ( var i = 0, ol = obj.length, val = obj[0]; - i < ol && fn.call(val,i,val) !== false; val = obj[++i] ); + i < ol && fn.call(val,i,val) !== false; val = obj[++i] ){} } return obj; @@ -2227,7 +2231,8 @@ jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", - insertAfter: "after" + insertAfter: "after", + replaceAll: "replaceWith" }, function(i,n){ jQuery.fn[ i ] = function(){ var a = arguments; @@ -2422,6 +2427,7 @@ jQuery.each( { * @param String str The string that will be contained within the text of an element. * @cat DOM/Traversing */ +// DEPRECATED jQuery.each( [ "eq", "lt", "gt", "contains" ], function(i,n){ jQuery.fn[ n ] = function(num,fn) { return this.filter( ":" + n + "(" + num + ")", fn );