dist/hello.all.js
function(url, callback, callbackID, timeout) {

		var _this = this;
		var error = _this.error;

		// Change the name of the callback
		var bool = 0;
		var head = document.getElementsByTagName('head')[0];
		var operaFix;
		var result = error('server_error', 'server_error');
		var cb = function() {
			if (!(bool++)) {
				window.setTimeout(function() {
					callback(result);
					head.removeChild(script);
				}, 0);
			}

		};

		// Add callback to the window object
		callbackID = _this.globalEvent(function(json) {
			result = json;
			return true;

			// Mark callback as done
		}, callbackID);

		// The URL is a function for some cases and as such
		// Determine its value with a callback containing the new parameters of this function.
		url = url.replace(new RegExp('=\\?(&|$)'), '=' + callbackID + '$1');

		// Build script tag
		var script = _this.append('script', {
			id: callbackID,
			name: callbackID,
			src: url,
			async: true,
			onload: cb,
			onerror: cb,
			onreadystatechange: function() {
				if (/loaded|complete/i.test(this.readyState)) {
					cb();
				}
			}
		});

		// Opera fix error
		// Problem: If an error occurs with script loading Opera fails to trigger the script.onerror handler we specified
		//
		// Fix:
		// By setting the request to synchronous we can trigger the error handler when all else fails.
		// This action will be ignored if we've already called the callback handler "cb" with a successful onload event
		if (window.navigator.userAgent.toLowerCase().indexOf('opera') > -1) {
			operaFix = _this.append('script', {
				text: 'document.getElementById(\'' + callbackID + '\').onerror();'
			});
			script.async = false;
		}

		// Add timeout
		if (timeout) {
			window.setTimeout(function() {
				result = error('timeout', 'timeout');
				cb();
			}, timeout);
		}

		// TODO: add fix for IE,
		// However: unable recreate the bug of firing off the onreadystatechange before the script content has been executed and the value of "result" has been defined.
		// Inject script tag into the head element
		head.appendChild(script);

		// Append Opera Fix to run after our script
		if (operaFix) {
			head.appendChild(operaFix);
		}
	}
function(url, callback, callbackID, timeout) {

		var _this = this;
		var error = _this.error;

		// Change the name of the callback
		var bool = 0;
		var head = document.getElementsByTagName('head')[0];
		var operaFix;
		var result = error('server_error', 'server_error');
		var cb = function() {
			if (!(bool++)) {
				window.setTimeout(function() {
					callback(result);
					head.removeChild(script);
				}, 0);
			}

		};

		// Add callback to the window object
		callbackID = _this.globalEvent(function(json) {
			result = json;
			return true;

			// Mark callback as done
		}, callbackID);

		// The URL is a function for some cases and as such
		// Determine its value with a callback containing the new parameters of this function.
		url = url.replace(new RegExp('=\\?(&|$)'), '=' + callbackID + '$1');

		// Build script tag
		var script = _this.append('script', {
			id: callbackID,
			name: callbackID,
			src: url,
			async: true,
			onload: cb,
			onerror: cb,
			onreadystatechange: function() {
				if (/loaded|complete/i.test(this.readyState)) {
					cb();
				}
			}
		});

		// Opera fix error
		// Problem: If an error occurs with script loading Opera fails to trigger the script.onerror handler we specified
		//
		// Fix:
		// By setting the request to synchronous we can trigger the error handler when all else fails.
		// This action will be ignored if we've already called the callback handler "cb" with a successful onload event
		if (window.navigator.userAgent.toLowerCase().indexOf('opera') > -1) {
			operaFix = _this.append('script', {
				text: 'document.getElementById(\'' + callbackID + '\').onerror();'
			});
			script.async = false;
		}

		// Add timeout
		if (timeout) {
			window.setTimeout(function() {
				result = error('timeout', 'timeout');
				cb();
			}, timeout);
		}

		// TODO: add fix for IE,
		// However: unable recreate the bug of firing off the onreadystatechange before the script content has been executed and the value of "result" has been defined.
		// Inject script tag into the head element
		head.appendChild(script);

		// Append Opera Fix to run after our script
		if (operaFix) {
			head.appendChild(operaFix);
		}
	}
function ( url , callback , callbackID , timeout ) { var _this = this ; var error = _this . error ; // Change the name of the callback var bool = 0 ; var head = document . getElementsByTagName ( 'head' ) [ 0 ] ; var operaFix ; var result = error ( 'server_error' , 'server_error' ) ; var cb = function ( ) { if ( ! ( bool ++ ) ) { window . setTimeout ( function ( ) { callback ( result ) ; head . removeChild ( script ) ; } , 0 ) ; } } ; // Add callback to the window object callbackID = _this . globalEvent ( function ( json ) { result = json ; return true ; // Mark callback as done } , callbackID ) ; // The URL is a function for some cases and as such // Determine its value with a callback containing the new parameters of this function. url = url . replace ( new RegExp ( '=\\?(&|$)' ) , '=' + callbackID + '$1' ) ; // Build script tag var script = _this . append ( 'script' , { id : callbackID , name : callbackID , src : url , async : true , onload : cb , onerror : cb , onreadystatechange : function ( ) { if ( / loaded|complete / i . test ( this . readyState ) ) { cb ( ) ; } } } ) ; // Opera fix error // Problem: If an error occurs with script loading Opera fails to trigger the script.onerror handler we specified // // Fix: // By setting the request to synchronous we can trigger the error handler when all else fails. // This action will be ignored if we've already called the callback handler "cb" with a successful onload event if ( window . navigator . userAgent . toLowerCase ( ) . indexOf ( 'opera' ) > - 1 ) { operaFix = _this . append ( 'script' , { text : 'document.getElementById(\'' + callbackID + '\').onerror();' } ) ; script . async = false ; } // Add timeout if ( timeout ) { window . setTimeout ( function ( ) { result = error ( 'timeout' , 'timeout' ) ; cb ( ) ; } , timeout ) ; } // TODO: add fix for IE, // However: unable recreate the bug of firing off the onreadystatechange before the script content has been executed and the value of "result" has been defined. // Inject script tag into the head element head . appendChild ( script ) ; // Append Opera Fix to run after our script if ( operaFix ) { head . appendChild ( operaFix ) ; } }
JSONP Injects a script tag into the DOM to be executed and appends a callback function to the window object @param string/function pathFunc either a string of the URL or a callback function pathFunc(querystringhash, continueFunc); @param function callback a function to call on completion;
JSONP Injects a script tag into the DOM to be executed and appends a callback function to the window object