Thread:Talk:ResourceLoader/Migration guide for extension developers/Getting started/reply

You are probably operating under the assumption that your code is being run in the global scope. ResourceLoader encapsulates code in closures which are executed as soon as all of their dependencies are met, meaning that all of the functions and variables you created are only defined within the scope of the closure. If you want to export functions or variables to the global scope, just use  or   You will be able to refer to them as you normally would from there on out. I will note however that polluting the global scope is tempting, but you should seriously consider wither making your code a jQuery plug-in or following the model of mediaWiki and jQuery objects, in which your entire library is encapsulated in a single object. --Trevor Parscal 00:09, 13 October 2010 (UTC)