Index: src/jquery/jquery.js =================================================================== --- src/jquery/jquery.js (revision 216) +++ src/jquery/jquery.js (working copy) @@ -1561,7 +1561,7 @@ this.remove( element, j ); }, - trigger: function(type,data,element) { + trigger: function(type,data,element,loadobj) { // Touch up the incoming data data = data || []; @@ -1570,12 +1570,16 @@ var g = this.global[type]; if ( g ) for ( var i = 0; i < g.length; i++ ) - this.trigger( type, data, g[i] ); + this.trigger( type, data, g[i], loadobj ); // Handle triggering a single element } else if ( element["on" + type] ) { // Pass along a fake event - data.unshift( this.fix({ type: type, target: element }) ); + if( loadobj ) { + data.unshift( this.fix({ type: type, target: element, loadobj: loadobj }) ); + } else { + data.unshift( this.fix({ type: type, target: element }) ); + } // Trigger the event element["on" + type].apply( element, data ); Index: src/ajax/ajax.js =================================================================== --- src/ajax/ajax.js (revision 216) +++ src/ajax/ajax.js (working copy) @@ -43,12 +43,14 @@ self.html(res.responseText).each( callback, [res.responseText, status] ); // Execute all the scripts inside of the newly-injected HTML - $("script", self).each(function(){ + self.find("script").each(function(){ if ( this.src ) $.getScript( this.src ); else eval.call( window, this.text || this.textContent || this.innerHTML || "" ); - }); + }).end(); + + jQuery.event.trigger( "loadSuccess", undefined, undefined, self ); } else callback.apply( self, [res.responseText, status] ); @@ -68,7 +70,7 @@ // Attach a bunch of functions for handling common AJAX events new function(){ - var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(','); + var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,loadSuccess".split(','); for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i];