Skip to main content

Bug Tracker

Side navigation

Ticket #4683: patch.txt


File patch.txt, 1.6 KB (added by inez, May 21, 2009 01:28PM UTC)
@@ -3394,6 +3394,8 @@
 	// Last-Modified header cache for next request
 	lastModified: {},
 
+	getScriptTimer: {},
+
 	ajax: function( s ) {
 		// Extend the settings, but re-extend 's' so that it can be
 		// checked again later (in the test suite, specifically)
@@ -3483,19 +3485,30 @@
 			if ( !jsonp ) {
 				var done = false;
 
-				// Attach handlers for all browsers
-				script.onload = script.onreadystatechange = function(){
-					if ( !done && (!this.readyState ||
-							this.readyState == "loaded" || this.readyState == "complete") ) {
-						done = true;
-						success();
-						complete();
+				if(($.browser.safari && !navigator.userAgent.match(/Version\/3/)) || $.browser.opera) {
+					$.getScriptTimer[s.url] = setInterval(function() {
+						if(!done && /loaded|complete/.test(document.readyState)) {
+							clearInterval($.getScriptTimer[s.url]);
+							done = true;
+							success();
+							complete();
+						}
+					}, 10);
+				} else {
+					// Attach handlers for all browsers
+					script.onload = script.onreadystatechange = function(){
+						if ( !done && (!this.readyState ||
+								this.readyState == "loaded" || this.readyState == "complete") ) {
+							done = true;
+							success();
+							complete();
 
-						// Handle memory leak in IE
-						script.onload = script.onreadystatechange = null;
-						head.removeChild( script );
-					}
-				};
+							// Handle memory leak in IE
+							script.onload = script.onreadystatechange = null;
+							head.removeChild( script );
+						}
+					};
+				}
 			}
 
 			head.appendChild(script);

Download in other formats:

Original Format