Skip to main content

Bug Tracker

Side navigation

Ticket #4801: clean.patch
File clean.patch, 1.0 KB (added by aq1018, June 22, 2009 08:06AM UTC)

This is a patch to address this issue.

Index: src/core.js
===================================================================
--- src/core.js	(revision 6410)
+++ src/core.js	(working copy)
@@ -939,8 +939,16 @@
 				if ( 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 )
-						ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
+					if ( ret[i].nodeType === 1 ) {
+						var scriptChildren = jQuery.makeArray(ret[i].getElementsByTagName("script"))
+						for (var j = 0; j < scriptChildren.length; j++) {
+							if (scriptChildren[j].type && scriptChildren[j].type.toLowerCase() !== 'text/javascript') {
+								scriptChildren.splice(j, 1);
+								j--;
+							}
+						}
+						ret.splice.apply( ret, [i + 1, 0].concat(scriptChildren) );
+					}
 					fragment.appendChild( ret[i] );
 				}
 			}

Download in other formats:

Original Format