rem: for (i = elements.length - 1; i >= 0; --i) { Wicket.Head.addJavascripts(elements[i]); } 
add:  if (element.tagName == "SCRIPT") {  Wicket.Head.addJavascripts(element); } else { for (i = elements.length - 1; i >= 0; --i) { Wicket.Head.addJavascripts(elements[i]); } }  
context: Wicket.replaceOuterHtml = function(element, text) {	    if (element.outerHTML) { // internet explorer or opera support outerHtml		var parent = element.parentNode;       		// find out the element's index and next element (if any). 		// outerHtml can replace element with multiple elements and we need		// to track the new elements in order to execute the script elements		// they contain		var i;		var next = null; // next element will be stored here		for (i = 0; i < parent.childNodes.length; ++i) {			if (parent.childNodes[i] == element) {				if (i != parent.childNodes.length - 1) {       				next = parent.childNodes[i+1]       			}       			break;       			       		}		}			   		var tn = element.tagName;		// elements inside tables have to be treated special		if (tn != 'TBODY' && tn != 'TR' && tn != "TD" && tn != "THEAD") {			// not inside table - regular replace			element.outerHTML = text;								} else {	  					// this is a hack to get around the fact that internet explorer doesn't allow the			// outerHtml attribute on table elements							var tempDiv = document.createElement("div");			tempDiv.innerHTML = '<table style="display: none">' + text + '</table>';							// we may have inserted multiple elements, so we need to take care of all of them			var tempParent = tempDiv.getElementsByTagName(tn).item(0).parentNode;			while(tempParent.childNodes.length > 0) {				var tempElement = tempParent.childNodes[0];				element.parentNode.insertBefore(tempElement, element);			}			//element.parentNode.replaceChild(tempDiv.getElementsByTagName(tn).item(0), element);			element.parentNode.removeChild(element);								}       	    // execute inserted javascripts	        	var elements = new Array();    		for (var j = i; j < parent.childNodes.length && parent.childNodes[j] != next; ++j) {	   					// add the inserted elements to array			elements.push(parent.childNodes[j]);		}					// we need to execute the javascript in reverse order to be consistent with firefox 		for (i = elements.length - 1; i >= 0; --i) {			Wicket.Head.addJavascripts(elements[i]); 		}								    } else {    	// create range and fragment        var range = element.ownerDocument.createRange();        range.selectNode(element);		var fragment = range.createContextualFragment(text);				// get the elements to be added		var elements = new Array();		for (var i = 0; i < fragment.childNodes.length; ++i)			elements.push(fragment.childNodes[i]);        element.parentNode.replaceChild(fragment, element);        		if (document.all != null) {			for (var i in elements) {				Wicket.Head.addJavascripts(elements[i]);			}		}    }		}	
meta: 1204	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1204/2dba2a07270de0c5400720ef0631712b8ecfa3fa/wicket-ajax.js/buggy/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js