| @@ 9225-9256 (lines=32) @@ | ||
| 9222 | } ); |
|
| 9223 | ||
| 9224 | // Bind script tag hack transport |
|
| 9225 | jQuery.ajaxTransport( "script", function( s ) { |
|
| 9226 | ||
| 9227 | // This transport only deals with cross domain requests |
|
| 9228 | if ( s.crossDomain ) { |
|
| 9229 | var script, callback; |
|
| 9230 | return { |
|
| 9231 | send: function( _, complete ) { |
|
| 9232 | script = jQuery( "<script>" ).prop( { |
|
| 9233 | charset: s.scriptCharset, |
|
| 9234 | src: s.url |
|
| 9235 | } ).on( |
|
| 9236 | "load error", |
|
| 9237 | callback = function( evt ) { |
|
| 9238 | script.remove(); |
|
| 9239 | callback = null; |
|
| 9240 | if ( evt ) { |
|
| 9241 | complete( evt.type === "error" ? 404 : 200, evt.type ); |
|
| 9242 | } |
|
| 9243 | } |
|
| 9244 | ); |
|
| 9245 | ||
| 9246 | // Use native DOM manipulation to avoid our domManip AJAX trickery |
|
| 9247 | document.head.appendChild( script[ 0 ] ); |
|
| 9248 | }, |
|
| 9249 | abort: function() { |
|
| 9250 | if ( callback ) { |
|
| 9251 | callback(); |
|
| 9252 | } |
|
| 9253 | } |
|
| 9254 | }; |
|
| 9255 | } |
|
| 9256 | } ); |
|
| 9257 | ||
| 9258 | ||
| 9259 | ||
| @@ 8671-8700 (lines=30) @@ | ||
| 8668 | }); |
|
| 8669 | ||
| 8670 | // Bind script tag hack transport |
|
| 8671 | jQuery.ajaxTransport( "script", function( s ) { |
|
| 8672 | // This transport only deals with cross domain requests |
|
| 8673 | if ( s.crossDomain ) { |
|
| 8674 | var script, callback; |
|
| 8675 | return { |
|
| 8676 | send: function( _, complete ) { |
|
| 8677 | script = jQuery("<script>").prop({ |
|
| 8678 | async: true, |
|
| 8679 | charset: s.scriptCharset, |
|
| 8680 | src: s.url |
|
| 8681 | }).on( |
|
| 8682 | "load error", |
|
| 8683 | callback = function( evt ) { |
|
| 8684 | script.remove(); |
|
| 8685 | callback = null; |
|
| 8686 | if ( evt ) { |
|
| 8687 | complete( evt.type === "error" ? 404 : 200, evt.type ); |
|
| 8688 | } |
|
| 8689 | } |
|
| 8690 | ); |
|
| 8691 | document.head.appendChild( script[ 0 ] ); |
|
| 8692 | }, |
|
| 8693 | abort: function() { |
|
| 8694 | if ( callback ) { |
|
| 8695 | callback(); |
|
| 8696 | } |
|
| 8697 | } |
|
| 8698 | }; |
|
| 8699 | } |
|
| 8700 | }); |
|
| 8701 | ||
| 8702 | ||
| 8703 | ||