mirror of
https://github.com/jquery/jquery.git
synced 2026-02-17 02:51:48 -05:00
jquery core: Closes #3255. The div used in jQuery.clean is emptied in the end. Cleaning the parentNode's properties of the elements.
This commit is contained in:
@@ -909,13 +909,14 @@ jQuery.extend({
|
||||
},
|
||||
|
||||
clean: function( elems, context, fragment ) {
|
||||
var ret = [], scripts = [];
|
||||
context = context || document;
|
||||
|
||||
// !context.createElement fails in IE with an error but returns typeof 'object'
|
||||
if ( typeof context.createElement === "undefined" )
|
||||
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
|
||||
|
||||
var ret = [], scripts = [], div = context.createElement("div");
|
||||
|
||||
jQuery.each(elems, function(i, elem){
|
||||
if ( typeof elem === "number" )
|
||||
elem += '';
|
||||
@@ -933,7 +934,7 @@ jQuery.extend({
|
||||
});
|
||||
|
||||
// Trim whitespace, otherwise indexOf won't work as expected
|
||||
var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div");
|
||||
var tags = jQuery.trim( elem ).toLowerCase();
|
||||
|
||||
var wrap =
|
||||
// option or optgroup
|
||||
@@ -1009,6 +1010,9 @@ jQuery.extend({
|
||||
ret = jQuery.merge( ret, elem );
|
||||
|
||||
});
|
||||
|
||||
// Clean up
|
||||
div.innerHTML = "";
|
||||
|
||||
if ( fragment ) {
|
||||
for ( var i = 0; ret[i]; i++ ) {
|
||||
|
||||
Reference in New Issue
Block a user