git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2d0bc7c
)
bug 6158; fixing replaceWith from throwing errors on empty elements
author
Jordan Boesch
<jboesch26@gmail.com>
Sat, 5 Mar 2011 15:30:29 +0000
(09:30 -0600)
committer
Jordan Boesch
<jboesch26@gmail.com>
Sat, 5 Mar 2011 15:30:29 +0000
(09:30 -0600)
src/manipulation.js
patch
|
blob
|
history
diff --git
a/src/manipulation.js
b/src/manipulation.js
index
ba31697
..
a4a81de
100644
(file)
--- a/
src/manipulation.js
+++ b/
src/manipulation.js
@@
-261,6
+261,9
@@
jQuery.fn.extend({
}
});
} else {
+ if ( !this.length ) {
+ return this;
+ }
return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
}
},