2014.11.24.Wrestle with the async script loading problem

Simply, I need to load http://dev.wikia.com/wiki/Colors/code.js AND EXECUTE it before I can use its objects (dev.colors.*), otherwise they are undefined. After 2 days digging the sucking Wikia & MW & JS mess, I've come to 4 (possible) solutions: 1. Use Wikia's importScriptPages/importArticles, then WAIT.... 1.1. (Wait) for document.ready: Too EARLY! dev still undefined. 1.2. (Wait) for window.load: OK, got dev.colors.*, but too LATE! 2. Use MediaWiki's ResourceLoader: Don't know how to "register" dev.colors !!! 3. Use jQuery's getScript/ajax, then wait for CALLBACK ==> "done" but received script is undefined! WTF??? <-- Reason is (maybe) the "same origin" policy + jQuery's fake "done" (should be "fail" insteads!) 4. Use HTML tag &lt;script>: This can pass the "same origin" policy, but unable to get when its execution is finished event with async="false" and defer="false". --> still get dev undefined, or have to wait for the late window.load, like solution 1.