lib/abaaso.js
function ( uri, success, failure, args ) {
		var defer    = deferred(),
		    callback = "callback", cbid, s;

		if ( external === undefined ) {
			if ( global.abaaso === undefined ) {
				utility.define( "abaaso.callback", {}, global );
			}

			external = "abaaso";
		}

		if ( args instanceof Object && args.callback !== undefined ) {
			callback = args.callback;
		}

		defer.then( function (arg ) {
			if ( typeof success === "function") {
				success( arg );
			}
		}, function ( e ) {
			if ( typeof failure === "function") {
				failure( e );
			}

			throw e;
		});

		do {
			cbid = utility.genId().slice( 0, 10 );
		}
		while ( global.abaaso.callback[cbid] !== undefined );

		uri = uri.replace( callback + "=?", callback + "=" + external + ".callback." + cbid );

		global.abaaso.callback[cbid] = function ( arg ) {
			clearTimeout( utility.timer[cbid] );
			delete utility.timer[cbid];
			delete global.abaaso.callback[cbid];
			defer.resolve( arg );
			element.destroy( s );
		};

		s = element.create( "script", {src: uri, type: "text/javascript"}, utility.$( "head" )[0] );
		
		utility.defer( function () {
			defer.reject( undefined );
		}, 30000, cbid );

		return defer;
	}
function ( uri, success, failure, args ) {
		var defer    = deferred(),
		    callback = "callback", cbid, s;

		if ( external === undefined ) {
			if ( global.abaaso === undefined ) {
				utility.define( "abaaso.callback", {}, global );
			}

			external = "abaaso";
		}

		if ( args instanceof Object && args.callback !== undefined ) {
			callback = args.callback;
		}

		defer.then( function (arg ) {
			if ( typeof success === "function") {
				success( arg );
			}
		}, function ( e ) {
			if ( typeof failure === "function") {
				failure( e );
			}

			throw e;
		});

		do {
			cbid = utility.genId().slice( 0, 10 );
		}
		while ( global.abaaso.callback[cbid] !== undefined );

		uri = uri.replace( callback + "=?", callback + "=" + external + ".callback." + cbid );

		global.abaaso.callback[cbid] = function ( arg ) {
			clearTimeout( utility.timer[cbid] );
			delete utility.timer[cbid];
			delete global.abaaso.callback[cbid];
			defer.resolve( arg );
			element.destroy( s );
		};

		s = element.create( "script", {src: uri, type: "text/javascript"}, utility.$( "head" )[0] );
		
		utility.defer( function () {
			defer.reject( undefined );
		}, 30000, cbid );

		return defer;
	}
function ( uri , success , failure , args ) { var defer = deferred ( ) , callback = "callback" , cbid , s ; if ( external === undefined ) { if ( global . abaaso === undefined ) { utility . define ( "abaaso.callback" , { } , global ) ; } external = "abaaso" ; } if ( args instanceof Object && args . callback !== undefined ) { callback = args . callback ; } defer . then ( function ( arg ) { if ( typeof success === "function" ) { success ( arg ) ; } } , function ( e ) { if ( typeof failure === "function" ) { failure ( e ) ; } throw e ; } ) ; do { cbid = utility . genId ( ) . slice ( 0 , 10 ) ; } while ( global . abaaso . callback [ cbid ] !== undefined ) ; uri = uri . replace ( callback + "=?" , callback + "=" + external + ".callback." + cbid ) ; global . abaaso . callback [ cbid ] = function ( arg ) { clearTimeout ( utility . timer [ cbid ] ) ; delete utility . timer [ cbid ] ; delete global . abaaso . callback [ cbid ] ; defer . resolve ( arg ) ; element . destroy ( s ) ; } ; s = element . create ( "script" , { src : uri , type : "text/javascript" } , utility . $ ( "head" ) [ 0 ] ) ; utility . defer ( function ( ) { defer . reject ( undefined ) ; } , 30000 , cbid ) ; return defer ; }
Creates a JSONP request

@method jsonp
@param  {String}   uri     URI to request
@param  {Function} success A handler function to execute when an appropriate response been received
@param  {Function} failure [Optional] A handler function to execute on error
@param  {Mixed}    args    Custom JSONP handler parameter name, default is "callback"; or custom headers for GET request ( CORS )
@return {Object}           Deferred
Creates a JSONP request