web-wiki/resources/mediawiki/mediawiki.js
/**
			 * Adds a script tag to the DOM, either using document.write or low-level DOM manipulation,
			 * depending on whether document-ready has occured yet and whether we are in async mode.
			 *
			 * @param src String: URL to script, will be used as the src attribute in the script tag
			 * @param callback Function: Optional callback which will be run when the script is done
			 */
Adds a script tag to the DOM, either using document.write or low-level DOM manipulation,
depending on whether document-ready has occured yet and whether we are in async mode.

@param src String: URL to script, will be used as the src attribute in the script tag
@param callback Function: Optional callback which will be run when the script is done
Adds a script tag to the DOM either using document . write or low - level DOM manipulation depending on whether document - ready has occured yet and whether we are in async mode . @param src String : URL to script will be used as the src attribute in the script tag @param callback Function : Optional callback which will be run when the script is done
function addScript( src, callback, async ) {
				var done = false, script, head;
				if ( ready || async ) {
					script = document.createElement( 'script' );
					script.setAttribute( 'src', src );
					script.setAttribute( 'type', 'text/javascript' );
					if ( $.isFunction( callback ) ) {
						script.onload = script.onreadystatechange = function() {
							if (
								!done
								&& (
									!script.readyState
									|| /loaded|complete/.test( script.readyState )
								)
							) {
								done = true;
								callback();
								try {
									script.onload = script.onreadystatechange = null;
									if ( script.parentNode ) {
										script.parentNode.removeChild( script );
									}
									script = undefined;
								} catch ( e ) { }
							}
						};
					}
					if ( window.opera ) {
						$( function() { document.body.appendChild( script ); } );
					} else {
						head = document.getElementsByTagName( 'head' )[0];
						( document.body || head ).appendChild( script );
					}
				} else {
					document.write( mw.html.element(
						'script', { 'type': 'text/javascript', 'src': src }, ''
					) );
					if ( $.isFunction( callback ) ) {
						callback();
					}
				}
			}
function addScript ( src , callback , async ) { var done = false , script , head ; if ( ready || async ) { script = document . createElement ( 'script' ) ; script . setAttribute ( 'src' , src ) ; script . setAttribute ( 'type' , 'text/javascript' ) ; if ( $ . isFunction ( callback ) ) { script . onload = script . onreadystatechange = function ( ) { if ( ! done && ( ! script . readyState || / loaded|complete / . test ( script . readyState ) ) ) { done = true ; callback ( ) ; try { script . onload = script . onreadystatechange = null ; if ( script . parentNode ) { script . parentNode . removeChild ( script ) ; } script = undefined ; } catch ( e ) { } } } ; } if ( window . opera ) { $ ( function ( ) { document . body . appendChild ( script ) ; } ) ; } else { head = document . getElementsByTagName ( 'head' ) [ 0 ] ; ( document . body || head ) . appendChild ( script ) ; } } else { document . write ( mw . html . element ( 'script' , { 'type' : 'text/javascript' , 'src' : src } , '' ) ) ; if ( $ . isFunction ( callback ) ) { callback ( ) ; } } }
Adds a script tag to the DOM, either using document.write or low-level DOM manipulation,
 depending on whether document-ready has occured yet and whether we are in async mode.
Adds a script tag to the DOM either using document . write or low - level DOM manipulation depending on whether document - ready has occured yet and whether we are in async mode .
// jQuery's getScript method is NOT better than doing this the old-fashioned way
 // because jQuery will eval the script's code, and errors will not have sane
 // line numbers.
 // Attach handlers for all browsers (based on jQuery.ajax)
 // Handle memory leak in IE. This seems to fail in
 // IE7 sometimes (Permission Denied error when
 // accessing script.parentNode) so wrap it in
 // a try catch.
 // Dereference the script
 // Appending to the <head> blocks rendering completely in Opera,
 // so append to the <body> after document ready. This means the
 // scripts only start loading after  the document has been rendered,
 // but so be it. Opera users don't deserve faster web pages if their
 // browser makes it impossible
 // IE-safe way of getting the <head> . document.documentElement.head doesn't
 // work in scripts that run in the <head>
 // Document.write is synchronous, so this is called when it's done
 // FIXME: that's a lie. doc.write isn't actually synchronous
