diff --git a/src/core.js b/src/core.js index 209fbc86a..2f45050e1 100644 --- a/src/core.js +++ b/src/core.js @@ -518,7 +518,8 @@ jQuery.extend({ } parsed = jQuery.buildFragment( [ data ], context, scripts ); - if ( scripts ) { + + if ( scripts && scripts.length ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes );