resourceloader: Async all the way
[lhc/web/wiklou.git] / resources / src / startup.js
index 97fa134..d4cfa02 100644 (file)
@@ -93,5 +93,14 @@ function startUp() {
 
 // Conditional script injection
 if ( isCompatible() ) {
-       document.write( $VARS.baseModulesScript );
+       ( function () {
+               var script = document.createElement( 'script' );
+               script.src = $VARS.baseModulesUri;
+               document.getElementsByTagName( 'head' )[0].appendChild( script );
+       }() );
+} else {
+       // Undo class swapping in case of an unsupported browser.
+       // See OutputPage::getHeadScripts().
+       document.documentElement.className = document.documentElement.className
+               .replace( /(^|\s)client-js(\s|$)/, '$1client-nojs$2' );
 }