User:Cavila/JavaScript
Appearance
Notes
- This post by Timo Tijhof (Krinkle) from a couple of years back may help to clarify some things about the situation with ResourceLoader vs other, 'local' ways of using JS.
- ResourceLoader/Core_modules#mediaWiki.loader - don't use document.write but mw.loader.load
- What about JS that executes
- on page load =>
- after page load =>
ResourceLoader clients:
- mw.loader.load (modules , [type])
- mw.loader.using (dependencies, [ready], [error]) : to be used if there's a dependency on modules; executes callback function after loading those modules.
- jQuery.getScript : for callbacks on external scripts
MediaWiki and JavaScript |
---|
JavaScript
Delivery
Adding JS on-wiki
Extensions, skins and other modules Further guidance |