3 // Install script dataType
6 script: "text/javascript, application/javascript"
12 "text script": jQuery.globalEval
16 // Handle cache's special case and global
17 jQuery.ajaxPrefilter( "script", function( s ) {
18 if ( s.cache === undefined ) {
21 if ( s.crossDomain ) {
27 // Bind script tag hack transport
28 jQuery.ajaxTransport( "script", function(s) {
30 // This transport only deals with cross domain requests
31 if ( s.crossDomain ) {
34 head = document.getElementsByTagName( "head" )[ 0 ] || document.documentElement;
38 send: function( _, callback ) {
40 script = document.createElement( "script" );
42 script.async = "async";
44 if ( s.scriptCharset ) {
45 script.charset = s.scriptCharset;
50 // Attach handlers for all browsers
51 script.onload = script.onreadystatechange = function( _, isAbort ) {
53 if ( !script.readyState || /loaded|complete/.test( script.readyState ) ) {
55 // Handle memory leak in IE
56 script.onload = script.onreadystatechange = null;
59 if ( head && script.parentNode ) {
60 head.removeChild( script );
63 // Dereference the script
66 // Callback if not abort
68 callback( 200, "success" );
72 // Use insertBefore instead of appendChild to circumvent an IE6 bug.
73 // This arises when a base node is used (#2709 and #4378).
74 head.insertBefore( script, head.firstChild );
79 script.onload( 0, 1 );