3 // Install script dataType
7 script: "text/javascript, application/javascript"
15 "text script": jQuery.globalEval
18 // Bind script tag hack transport
19 }).ajaxTransport("script", function(s) {
21 // Handle cache special case
22 if ( s.cache === undefined ) {
26 // This transport only deals with cross domain get requests
27 if ( s.crossDomain && s.async && ( s.type === "GET" || ! s.data ) ) {
32 head = document.getElementsByTagName("head")[0] || document.documentElement;
36 send: function(_, callback) {
38 script = document.createElement("script");
40 script.async = "async";
42 if ( s.scriptCharset ) {
43 script.charset = s.scriptCharset;
48 // Attach handlers for all browsers
49 script.onload = script.onreadystatechange = function( _ , isAbort ) {
51 if ( ! script.readyState || /loaded|complete/.test( script.readyState ) ) {
53 // Handle memory leak in IE
54 script.onload = script.onreadystatechange = null;
57 if ( head && script.parentNode ) {
58 head.removeChild( script );
61 // Dereference the script
64 // Callback if not abort
66 callback( 200, "success" );
70 // Use insertBefore instead of appendChild to circumvent an IE6 bug.
71 // This arises when a base node is used (#2709 and #4378).
72 head.insertBefore( script, head.firstChild );