Skip to content

Commit

Permalink
Merge branch 'jslint_function_in_loop' of https://github.com/timmywil…
Browse files Browse the repository at this point in the history
…/jquery into timmywil-jslint_function_in_loop
  • Loading branch information
dmethvin committed Apr 12, 2011
2 parents bebd8bc + 73f9ab6 commit 0032e30
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,8 @@ jQuery.extend({
},

clean: function( elems, context, fragment, scripts ) {
var checkScriptType;

context = context || document;

// !context.createElement fails in IE with an error but returns typeof 'object'
Expand Down Expand Up @@ -630,15 +632,16 @@ jQuery.extend({
}

if ( fragment ) {
checkScriptType = function( elem ) {
return !elem.type || rscriptType.test( elem.type );
};
for ( i = 0; ret[i]; i++ ) {
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );

} else {
if ( ret[i].nodeType === 1 ) {
var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), function( elem ) {
return !elem.type || rscriptType.test( elem.type );
});
var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );

ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
}
Expand Down

0 comments on commit 0032e30

Please sign in to comment.