Skip to main content

Bug Tracker

Side navigation

Ticket #407: ajax.js.2.patch
File ajax.js.2.patch, 1.6 KB (added by pmclanahan, November 20, 2006 07:13PM UTC)

Patch file from my post on 11-20-2006

Index: ajax.js
===================================================================
--- ajax.js	(revision 603)
+++ ajax.js	(working copy)
@@ -153,8 +153,7 @@
 	evalScripts: function() {
 		return this.find('script').each(function(){
 			if ( this.src )
-				// for some weird reason, it doesn't work if the callback is ommited
-				jQuery.getScript( this.src, function() {} );
+				jQuery.getScript( this.src );
 			else
 				eval.call( window, this.text || this.textContent || this.innerHTML || "" );
 		}).end();
@@ -778,9 +777,12 @@
 					if ( s.ifModified && modRes )
 						jQuery.lastModified[s.url] = modRes;
 
-					// If a local callback was specified, fire it
+					// process the data (runs the xml through httpData regardless of callback)
+					var data = jQuery.httpData( xml, s.dataType );
+					
+					// If a local callback was specified, fire it and pass it the data
 					if ( s.success )
-						s.success( jQuery.httpData( xml, s.dataType ), status );
+						s.success( data, status );
 
 					// Fire the global callback
 					if( s.global )
@@ -873,7 +875,13 @@
 		data = type == "xml" || data ? r.responseXML : r.responseText;
 
 		// If the type is "script", eval it
-		if ( type == "script" ) eval.call( window, data );
+		// implementation of global execution fix for IE by Jeff Watkins http://nerd.newburyportion.com/2006/07/going-global
+		if ( type == "script" ) {
+			if (window.execScript)
+				window.execScript( data );
+			else
+				window.setTimeout( data, 0 );
+		}
 
 		// Get the JavaScript object, if JSON is used.
 		if ( type == "json" ) eval( "data = " + data );

Download in other formats:

Original Format