aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-07-21 15:57:51 +0000
committerJohn Resig <jeresig@gmail.com>2009-07-21 15:57:51 +0000
commit7e06b9b70f23dffd9c74047895b53b28af0dafc6 (patch)
treef657ceaad3017945b6a0b3728b4a914b07922f55 /src/manipulation.js
parent7a67f8897d3c2ed97254f0fdb969be14e77962d1 (diff)
downloadjquery-7e06b9b70f23dffd9c74047895b53b28af0dafc6.tar.gz
jquery-7e06b9b70f23dffd9c74047895b53b28af0dafc6.zip
Tweaked the detach addition in commit [6474].
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 1b8066f00..dbf86a7b3 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -161,6 +161,10 @@ jQuery.fn.extend({
return this.after( value ).remove();
},
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
domManip: function( args, table, callback ) {
var fragment, scripts, cacheable, cached, cacheresults, first,
value = args[0];
@@ -256,14 +260,12 @@ jQuery.each({
cleanData( jQuery("*", this).add(this) );
}
- this.parentNode && this.parentNode.removeChild( this );
+ if ( this.parentNode ) {
+ this.parentNode.removeChild( this );
+ }
}
},
- detach: function( selector ) {
- jQuery( this ).remove( selector, true )
- },
-
empty: function() {
// Remove element nodes and prevent memory leaks
if ( this.nodeType === 1 ) {