src/openseadragon.js
function( options ){
            var script,
                url     = options.url,
                head    = document.head ||
                    document.getElementsByTagName( "head" )[ 0 ] ||
                    document.documentElement,
                jsonpCallback = options.callbackName || 'openseadragon' + $.now(),
                previous      = window[ jsonpCallback ],
                replace       = "$1" + jsonpCallback + "$2",
                callbackParam = options.param || 'callback',
                callback      = options.callback;

            url = url.replace( /(\=)\?(&|$)|\?\?/i, replace );
            // Add callback manually
            url += (/\?/.test( url ) ? "&" : "?") + callbackParam + "=" + jsonpCallback;

            // Install callback
            window[ jsonpCallback ] = function( response ) {
                if ( !previous ){
                    try{
                        delete window[ jsonpCallback ];
                    }catch(e){
                        //swallow
                    }
                } else {
                    window[ jsonpCallback ] = previous;
                }
                if( callback && $.isFunction( callback ) ){
                    callback( response );
                }
            };

            script = document.createElement( "script" );

            //TODO: having an issue with async info requests
            if( undefined !== options.async || false !== options.async ){
                script.async = "async";
            }

            if ( options.scriptCharset ) {
                script.charset = options.scriptCharset;
            }

            script.src = url;

            // Attach handlers for all browsers
            script.onload = script.onreadystatechange = function( _, isAbort ) {

                if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {

                    // Handle memory leak in IE
                    script.onload = script.onreadystatechange = null;

                    // Remove the script
                    if ( head && script.parentNode ) {
                        head.removeChild( script );
                    }

                    // Dereference the script
                    script = undefined;
                }
            };
            // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
            // This arises when a base node is used (#2709 and #4378).
            head.insertBefore( script, head.firstChild );

        }
function( options ){
            var script,
                url     = options.url,
                head    = document.head ||
                    document.getElementsByTagName( "head" )[ 0 ] ||
                    document.documentElement,
                jsonpCallback = options.callbackName || 'openseadragon' + $.now(),
                previous      = window[ jsonpCallback ],
                replace       = "$1" + jsonpCallback + "$2",
                callbackParam = options.param || 'callback',
                callback      = options.callback;

            url = url.replace( /(\=)\?(&|$)|\?\?/i, replace );
            // Add callback manually
            url += (/\?/.test( url ) ? "&" : "?") + callbackParam + "=" + jsonpCallback;

            // Install callback
            window[ jsonpCallback ] = function( response ) {
                if ( !previous ){
                    try{
                        delete window[ jsonpCallback ];
                    }catch(e){
                        //swallow
                    }
                } else {
                    window[ jsonpCallback ] = previous;
                }
                if( callback && $.isFunction( callback ) ){
                    callback( response );
                }
            };

            script = document.createElement( "script" );

            //TODO: having an issue with async info requests
            if( undefined !== options.async || false !== options.async ){
                script.async = "async";
            }

            if ( options.scriptCharset ) {
                script.charset = options.scriptCharset;
            }

            script.src = url;

            // Attach handlers for all browsers
            script.onload = script.onreadystatechange = function( _, isAbort ) {

                if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {

                    // Handle memory leak in IE
                    script.onload = script.onreadystatechange = null;

                    // Remove the script
                    if ( head && script.parentNode ) {
                        head.removeChild( script );
                    }

                    // Dereference the script
                    script = undefined;
                }
            };
            // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
            // This arises when a base node is used (#2709 and #4378).
            head.insertBefore( script, head.firstChild );

        }
function ( options ) { var script , url = options . url , head = document . head || document . getElementsByTagName ( "head" ) [ 0 ] || document . documentElement , jsonpCallback = options . callbackName || 'openseadragon' + $ . now ( ) , previous = window [ jsonpCallback ] , replace = "$1" + jsonpCallback + "$2" , callbackParam = options . param || 'callback' , callback = options . callback ; url = url . replace ( / (\=)\?(&|$)|\?\? / i , replace ) ; // Add callback manually url += ( / \? / . test ( url ) ? "&" : "?" ) + callbackParam + "=" + jsonpCallback ; // Install callback window [ jsonpCallback ] = function ( response ) { if ( ! previous ) { try { delete window [ jsonpCallback ] ; } catch ( e ) { //swallow } } else { window [ jsonpCallback ] = previous ; } if ( callback && $ . isFunction ( callback ) ) { callback ( response ) ; } } ; script = document . createElement ( "script" ) ; //TODO: having an issue with async info requests if ( undefined !== options . async || false !== options . async ) { script . async = "async" ; } if ( options . scriptCharset ) { script . charset = options . scriptCharset ; } script . src = url ; // Attach handlers for all browsers script . onload = script . onreadystatechange = function ( _ , isAbort ) { if ( isAbort || ! script . readyState || / loaded|complete / . test ( script . readyState ) ) { // Handle memory leak in IE script . onload = script . onreadystatechange = null ; // Remove the script if ( head && script . parentNode ) { head . removeChild ( script ) ; } // Dereference the script script = undefined ; } } ; // Use insertBefore instead of appendChild  to circumvent an IE6 bug. // This arises when a base node is used (#2709 and #4378). head . insertBefore ( script , head . firstChild ) ; }
Taken from jQuery 1.6.1
@function
@param {Object} options
@param {String} options.url
@param {Function} options.callback
@param {String} [options.param='callback'] The name of the url parameter
to request the jsonp provider with.
@param {String} [options.callbackName=] The name of the callback to
request the jsonp provider with.
Taken from jQuery 1 . 6 . 1