1 | @@ -3394,6 +3394,8 @@ |
---|
2 | // Last-Modified header cache for next request |
---|
3 | lastModified: {}, |
---|
4 | |
---|
5 | + getScriptTimer: {}, |
---|
6 | + |
---|
7 | ajax: function( s ) { |
---|
8 | // Extend the settings, but re-extend 's' so that it can be |
---|
9 | // checked again later (in the test suite, specifically) |
---|
10 | @@ -3483,19 +3485,30 @@ |
---|
11 | if ( !jsonp ) { |
---|
12 | var done = false; |
---|
13 | |
---|
14 | - // Attach handlers for all browsers |
---|
15 | - script.onload = script.onreadystatechange = function(){ |
---|
16 | - if ( !done && (!this.readyState || |
---|
17 | - this.readyState == "loaded" || this.readyState == "complete") ) { |
---|
18 | - done = true; |
---|
19 | - success(); |
---|
20 | - complete(); |
---|
21 | + if(($.browser.safari && !navigator.userAgent.match(/Version\/3/)) || $.browser.opera) { |
---|
22 | + $.getScriptTimer[s.url] = setInterval(function() { |
---|
23 | + if(!done && /loaded|complete/.test(document.readyState)) { |
---|
24 | + clearInterval($.getScriptTimer[s.url]); |
---|
25 | + done = true; |
---|
26 | + success(); |
---|
27 | + complete(); |
---|
28 | + } |
---|
29 | + }, 10); |
---|
30 | + } else { |
---|
31 | + // Attach handlers for all browsers |
---|
32 | + script.onload = script.onreadystatechange = function(){ |
---|
33 | + if ( !done && (!this.readyState || |
---|
34 | + this.readyState == "loaded" || this.readyState == "complete") ) { |
---|
35 | + done = true; |
---|
36 | + success(); |
---|
37 | + complete(); |
---|
38 | |
---|
39 | - // Handle memory leak in IE |
---|
40 | - script.onload = script.onreadystatechange = null; |
---|
41 | - head.removeChild( script ); |
---|
42 | - } |
---|
43 | - }; |
---|
44 | + // Handle memory leak in IE |
---|
45 | + script.onload = script.onreadystatechange = null; |
---|
46 | + head.removeChild( script ); |
---|
47 | + } |
---|
48 | + }; |
---|
49 | + } |
---|
50 | } |
---|
51 | |
---|
52 | head.appendChild(script); |
---|