git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added new replaceWith() (replace all matched elements with the specified HTML/DOM...
[jquery.git]
/
src
/
jquery
/
jquery.js
diff --git
a/src/jquery/jquery.js
b/src/jquery/jquery.js
index
4c5941b
..
8988c5e
100644
(file)
--- a/
src/jquery/jquery.js
+++ b/
src/jquery/jquery.js
@@
-1182,6
+1182,10
@@
jQuery.fn = jQuery.prototype = {
this.empty().append( val );
},
this.empty().append( val );
},
+ replaceWith: function( val ) {
+ return this.after( val ).remove();
+ },
+
slice: function() {
return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
},
slice: function() {
return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
},
@@
-2227,7
+2231,8
@@
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
- insertAfter: "after"
+ insertAfter: "after",
+ replaceAll: "replaceWith"
}, function(i,n){
jQuery.fn[ i ] = function(){
var a = arguments;
}, function(i,n){
jQuery.fn[ i ] = function(){
var a = arguments;