Provides a friendly wrapper for loading scripts using $.ajax(). Returns a promise when the script dependency -- a single script url -- has been loaded. This matches how mw.loader.load is able to load a script url, and how mw.loader.using will return a promised that is resolved when dependecies are loaded, or rejected if there is an error. Added as a separate function mw.loader.getScript(), rather than adding this functionality to using(), as it is a separate use case, less confusing for users, and there is no shared or duplicated code between loading a script and loading one or more named modules. Bug: T27962 Change-Id: I13be426d03261a2d0c6a1631af94a9f9af58394b
1 line
40 B
JavaScript
1 line
40 B
JavaScript
mw.getScriptExampleScriptLoaded = true;
|